diff --git a/.github/.test/samples.json b/.github/.test/samples.json
index 9d960634ec3b..9fb8604c194f 100644
--- a/.github/.test/samples.json
+++ b/.github/.test/samples.json
@@ -151,6 +151,12 @@
"Client: Dart"
]
},
+ {
+ "input": "dart-next-petstore.sh",
+ "matches": [
+ "Client: Dart"
+ ]
+ },
{
"input": "dart-petstore.sh",
"matches": [
diff --git a/bin/configs/dart-next-dio-built_value-v3.yaml b/bin/configs/dart-next-dio-built_value-v3.yaml
new file mode 100644
index 000000000000..aa5d08d10267
--- /dev/null
+++ b/bin/configs/dart-next-dio-built_value-v3.yaml
@@ -0,0 +1,15 @@
+generatorName: dart-next
+outputDir: samples/client/echo_api/dart/dio/built_value
+inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml
+templateDir: modules/openapi-generator/src/main/resources/dart-next
+typeMappings:
+ Client: "ModelClient"
+ File: "ModelFile"
+ EnumClass: "ModelEnumClass"
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ enumUnknownDefaultCase: "true"
+ library: dio
+ serializationLibrary: built_value
+reservedWordsMappings:
+ class: "classField"
diff --git a/bin/configs/dart-next-dio-json_serializable-v3.yaml b/bin/configs/dart-next-dio-json_serializable-v3.yaml
new file mode 100644
index 000000000000..dd6ecf828822
--- /dev/null
+++ b/bin/configs/dart-next-dio-json_serializable-v3.yaml
@@ -0,0 +1,13 @@
+generatorName: dart-next
+outputDir: samples/client/echo_api/dart/dio/json_serializable
+inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml
+templateDir: modules/openapi-generator/src/main/resources/dart-next
+typeMappings:
+ Client: "ModelClient"
+ File: "ModelFile"
+ EnumClass: "ModelEnumClass"
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ enumUnknownDefaultCase: "true"
+ library: dio
+ serializationLibrary: json_serializable
diff --git a/docs/generators.md b/docs/generators.md
index 1fe95d2ad933..6109dd235aa3 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -21,6 +21,7 @@ The following generators are available:
* [csharp](generators/csharp.md)
* [dart](generators/dart.md)
* [dart-dio](generators/dart-dio.md)
+* [dart-next (experimental)](generators/dart-next.md)
* [eiffel](generators/eiffel.md)
* [elixir](generators/elixir.md)
* [elm](generators/elm.md)
diff --git a/docs/generators/README.md b/docs/generators/README.md
index 3b624bd8b8f6..919a7dda6bc6 100644
--- a/docs/generators/README.md
+++ b/docs/generators/README.md
@@ -15,6 +15,7 @@ The following generators are available:
* [csharp-functions](csharp-functions.md)
* [dart](dart.md)
* [dart-dio](dart-dio.md)
+* [dart-next](dart-next.md)
* [eiffel](eiffel.md)
* [elixir](elixir.md)
* [elm](elm.md)
diff --git a/docs/generators/dart-next.md b/docs/generators/dart-next.md
new file mode 100644
index 000000000000..5d3f229df2ab
--- /dev/null
+++ b/docs/generators/dart-next.md
@@ -0,0 +1,257 @@
+---
+title: Documentation for the dart-next Generator
+---
+
+## METADATA
+
+| Property | Value | Notes |
+| -------- | ----- | ----- |
+| generator name | dart-next | pass this to the generate command after -g |
+| generator stability | EXPERIMENTAL | |
+| generator type | CLIENT | |
+| generator language | Dart | |
+| generator default templating engine | mustache | |
+| helpTxt | Generates a Dart client library. | |
+
+## CONFIG OPTIONS
+These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
+
+| Option | Description | Values | Default |
+| ------ | ----------- | ------ | ------- |
+|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
+|dateLibrary|Specify Date library|
**core** [DEFAULT] Dart core library (DateTime) **timemachine** Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing. |core|
+|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|**false** The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. **true** Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |true|
+|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
+|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true|
+|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|**true** The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. **false** The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. |true|
+|library|Specify networking library|**dio** [DEFAULT] dio **http** [BETA] http |dio|
+|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
+|pubAuthor|Author name in generated pubspec| |Author|
+|pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage|
+|pubDescription|Description in generated pubspec| |OpenAPI API client|
+|pubHomepage|Homepage in generated pubspec| |homepage|
+|pubLibrary|Library name in generated code| |openapi.api|
+|pubName|Name in generated pubspec| |openapi|
+|pubPublishTo|Publish_to in generated pubspec| |null|
+|pubRepository|Repository in generated pubspec| |null|
+|pubVersion|Version in generated pubspec| |1.0.0|
+|serializationLibrary|Specify serialization library|**built_value** [DEFAULT] built_value **json_serializable** [BETA] json_serializable |built_value|
+|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
+|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
+|sourceFolder|source folder for generated code| |src|
+|useEnumExtension|Allow the 'x-enum-values' extension for enums| |false|
+
+## IMPORT MAPPING
+
+| Type/Alias | Imports |
+| ---------- | ------- |
+
+
+## INSTANTIATION TYPES
+
+| Type/Alias | Instantiated By |
+| ---------- | --------------- |
+
+
+## LANGUAGE PRIMITIVES
+
+
+String
+bool
+double
+int
+num
+
+
+## RESERVED WORDS
+
+
+abstract
+as
+assert
+async
+await
+break
+case
+catch
+class
+const
+continue
+covariant
+default
+deferred
+do
+dynamic
+else
+enum
+export
+extends
+extension
+external
+factory
+false
+final
+finally
+for
+function
+get
+hide
+if
+implements
+import
+in
+inout
+interface
+is
+late
+library
+mixin
+native
+new
+null
+of
+on
+operator
+out
+part
+patch
+required
+rethrow
+return
+set
+show
+source
+static
+super
+switch
+sync
+this
+throw
+true
+try
+typedef
+var
+void
+while
+with
+yield
+
+
+## FEATURE SET
+
+
+### Client Modification Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|BasePath|✓|ToolingExtension
+|Authorizations|✓|ToolingExtension
+|UserAgent|✓|ToolingExtension
+|MockServer|✗|ToolingExtension
+
+### Data Type Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Custom|✗|OAS2,OAS3
+|Int32|✓|OAS2,OAS3
+|Int64|✓|OAS2,OAS3
+|Float|✓|OAS2,OAS3
+|Double|✓|OAS2,OAS3
+|Decimal|✓|ToolingExtension
+|String|✓|OAS2,OAS3
+|Byte|✓|OAS2,OAS3
+|Binary|✓|OAS2,OAS3
+|Boolean|✓|OAS2,OAS3
+|Date|✓|OAS2,OAS3
+|DateTime|✓|OAS2,OAS3
+|Password|✓|OAS2,OAS3
+|File|✓|OAS2
+|Uuid|✗|
+|Array|✓|OAS2,OAS3
+|Null|✗|OAS3
+|AnyType|✗|OAS2,OAS3
+|Object|✓|OAS2,OAS3
+|Maps|✓|ToolingExtension
+|CollectionFormat|✓|OAS2
+|CollectionFormatMulti|✓|OAS2
+|Enum|✓|OAS2,OAS3
+|ArrayOfEnum|✓|ToolingExtension
+|ArrayOfModel|✓|ToolingExtension
+|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
+|ArrayOfCollectionOfModel|✓|ToolingExtension
+|ArrayOfCollectionOfEnum|✓|ToolingExtension
+|MapOfEnum|✓|ToolingExtension
+|MapOfModel|✓|ToolingExtension
+|MapOfCollectionOfPrimitives|✓|ToolingExtension
+|MapOfCollectionOfModel|✓|ToolingExtension
+|MapOfCollectionOfEnum|✓|ToolingExtension
+
+### Documentation Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Readme|✓|ToolingExtension
+|Model|✓|ToolingExtension
+|Api|✓|ToolingExtension
+
+### Global Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Host|✓|OAS2,OAS3
+|BasePath|✓|OAS2,OAS3
+|Info|✓|OAS2,OAS3
+|Schemes|✗|OAS2,OAS3
+|PartialSchemes|✓|OAS2,OAS3
+|Consumes|✓|OAS2
+|Produces|✓|OAS2
+|ExternalDocumentation|✓|OAS2,OAS3
+|Examples|✓|OAS2,OAS3
+|XMLStructureDefinitions|✗|OAS2,OAS3
+|MultiServer|✗|OAS3
+|ParameterizedServer|✗|OAS3
+|ParameterStyling|✗|OAS3
+|Callbacks|✗|OAS3
+|LinkObjects|✗|OAS3
+
+### Parameter Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Path|✓|OAS2,OAS3
+|Query|✓|OAS2,OAS3
+|Header|✓|OAS2,OAS3
+|Body|✓|OAS2
+|FormUnencoded|✓|OAS2
+|FormMultipart|✓|OAS2
+|Cookie|✓|OAS3
+
+### Schema Support Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|Simple|✓|OAS2,OAS3
+|Composite|✓|OAS2,OAS3
+|Polymorphism|✓|OAS2,OAS3
+|Union|✓|OAS3
+|allOf|✓|OAS2,OAS3
+|anyOf|✓|OAS3
+|oneOf|✓|OAS3
+|not|✗|OAS3
+
+### Security Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|BasicAuth|✓|OAS2,OAS3
+|ApiKey|✓|OAS2,OAS3
+|OpenIDConnect|✗|OAS3
+|BearerToken|✓|OAS3
+|OAuth2_Implicit|✓|OAS2,OAS3
+|OAuth2_Password|✗|OAS2,OAS3
+|OAuth2_ClientCredentials|✗|OAS2,OAS3
+|OAuth2_AuthorizationCode|✗|OAS2,OAS3
+|SignatureAuth|✗|OAS3
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✗|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✗|OAS2,OAS3
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java
new file mode 100644
index 000000000000..ccd92373b12b
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java
@@ -0,0 +1,846 @@
+package org.openapitools.codegen.languages;
+
+import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
+import static org.openapitools.codegen.utils.StringUtils.camelize;
+import static org.openapitools.codegen.utils.StringUtils.escape;
+import static org.openapitools.codegen.utils.StringUtils.underscore;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.CodegenModel;
+import org.openapitools.codegen.CodegenOperation;
+import org.openapitools.codegen.CodegenProperty;
+import org.openapitools.codegen.CodegenType;
+import org.openapitools.codegen.DefaultCodegen;
+import org.openapitools.codegen.GeneratorLanguage;
+import org.openapitools.codegen.meta.features.ClientModificationFeature;
+import org.openapitools.codegen.meta.features.DocumentationFeature;
+import org.openapitools.codegen.meta.features.GlobalFeature;
+import org.openapitools.codegen.meta.features.ParameterFeature;
+import org.openapitools.codegen.meta.features.SchemaSupportFeature;
+import org.openapitools.codegen.meta.features.SecurityFeature;
+import org.openapitools.codegen.meta.features.WireFormatFeature;
+import org.openapitools.codegen.model.ModelMap;
+import org.openapitools.codegen.model.ModelsMap;
+import org.openapitools.codegen.model.OperationMap;
+import org.openapitools.codegen.model.OperationsMap;
+import org.openapitools.codegen.utils.ModelUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Sets;
+
+import io.swagger.v3.oas.models.media.ArraySchema;
+import io.swagger.v3.oas.models.media.ComposedSchema;
+import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.media.StringSchema;
+
+public abstract class DartNextAbstractCodegen extends DefaultCodegen {
+
+ private final Logger LOGGER = LoggerFactory.getLogger(AbstractDartCodegen.class);
+
+ protected static final List DEFAULT_SUPPORTED_CONTENT_TYPES = Arrays.asList(
+ "application/json", "application/x-www-form-urlencoded", "multipart/form-data");
+
+ public static final String PUB_LIBRARY = "pubLibrary";
+ public static final String PUB_NAME = "pubName";
+ public static final String PUB_VERSION = "pubVersion";
+ public static final String PUB_DESCRIPTION = "pubDescription";
+ public static final String PUB_AUTHOR = "pubAuthor";
+ public static final String PUB_AUTHOR_EMAIL = "pubAuthorEmail";
+ public static final String PUB_HOMEPAGE = "pubHomepage";
+ public static final String PUB_REPOSITORY = "pubRepository";
+ public static final String PUB_PUBLISH_TO = "pubPublishTo";
+ public static final String USE_ENUM_EXTENSION = "useEnumExtension";
+
+ protected String pubLibrary = "openapi.api";
+ protected String pubName = "openapi";
+ protected String pubVersion = "1.0.0";
+ protected String pubDescription = "OpenAPI API client";
+ protected String pubAuthor = "Author";
+ protected String pubAuthorEmail = "author@homepage";
+ protected String pubHomepage = "homepage";
+ protected String pubRepository = null;
+ protected String pubPublishTo = null;
+ protected boolean useEnumExtension = false;
+ protected String sourceFolder = "src";
+ protected String libPath = "lib" + File.separator;
+ protected String apiDocPath = "doc" + File.separator;
+ protected String modelDocPath = "doc" + File.separator;
+ protected String apiTestPath = "test" + File.separator;
+ protected String modelTestPath = "test" + File.separator;
+
+ protected Map imports = new HashMap<>();
+
+ public DartNextAbstractCodegen() {
+ super();
+
+ modifyFeatureSet(features -> features
+ .includeDocumentationFeatures(DocumentationFeature.Readme)
+ .securityFeatures(EnumSet.of(
+ SecurityFeature.OAuth2_Implicit,
+ SecurityFeature.BasicAuth,
+ SecurityFeature.BearerToken,
+ SecurityFeature.ApiKey
+ ))
+ .excludeGlobalFeatures(
+ GlobalFeature.XMLStructureDefinitions,
+ GlobalFeature.Callbacks,
+ GlobalFeature.LinkObjects,
+ GlobalFeature.ParameterStyling
+ )
+ .excludeSchemaSupportFeatures(
+ SchemaSupportFeature.Polymorphism,
+ SchemaSupportFeature.Union,
+ SchemaSupportFeature.Composite
+ )
+ .includeParameterFeatures(
+ ParameterFeature.Cookie
+ )
+ .includeClientModificationFeatures(
+ ClientModificationFeature.BasePath
+ )
+ .excludeWireFormatFeatures(
+ WireFormatFeature.XML
+ )
+ );
+
+ ///src/main/resources/dart-next
+ // outputFolder = "generated-code/dart";
+ modelTemplateFiles.put("model.mustache", ".dart");
+ apiTemplateFiles.put("api.mustache", ".dart");
+ // embeddedTemplateDir = templateDir = "dart2";
+ apiPackage = "api";
+ modelPackage = "model";
+ modelDocTemplateFiles.put("object_doc.mustache", ".md");
+ apiDocTemplateFiles.put("api_doc.mustache", ".md");
+
+ modelTestTemplateFiles.put("model_test.mustache", ".dart");
+ apiTestTemplateFiles.put("api_test.mustache", ".dart");
+
+ final List reservedWordsList = new ArrayList<>();
+ try (BufferedReader reader = new BufferedReader(
+ new InputStreamReader(DartClientCodegen.class.getResourceAsStream("/dart/dart-keywords.txt"),
+ StandardCharsets.UTF_8))) {
+ while (reader.ready()) {
+ reservedWordsList.add(reader.readLine());
+ }
+ } catch (Exception e) {
+ LOGGER.error("Error reading dart keywords. Exception: {}", e.getMessage());
+ }
+ setReservedWordsLowerCase(reservedWordsList);
+
+ // These types return isPrimitive=true in templates
+ languageSpecificPrimitives = Sets.newHashSet(
+ "String",
+ "bool",
+ "int",
+ "num",
+ "double"
+ );
+
+ typeMapping = new HashMap<>();
+ typeMapping.put("Array", "List");
+ typeMapping.put("array", "List");
+ typeMapping.put("map", "Map");
+ typeMapping.put("List", "List");
+ typeMapping.put("set", "Set");
+ typeMapping.put("boolean", "bool");
+ typeMapping.put("string", "String");
+ typeMapping.put("char", "String");
+ typeMapping.put("int", "int");
+ typeMapping.put("long", "int");
+ typeMapping.put("short", "int");
+ typeMapping.put("number", "num");
+ typeMapping.put("float", "double");
+ typeMapping.put("double", "double");
+ typeMapping.put("decimal", "double");
+ typeMapping.put("integer", "int");
+ typeMapping.put("Date", "DateTime");
+ typeMapping.put("date", "DateTime");
+ typeMapping.put("DateTime", "DateTime");
+ typeMapping.put("file", "MultipartFile");
+ typeMapping.put("binary", "MultipartFile");
+ typeMapping.put("UUID", "String");
+ typeMapping.put("URI", "String");
+ typeMapping.put("ByteArray", "String");
+ typeMapping.put("object", "Object");
+ typeMapping.put("AnyType", "Object");
+
+ // Data types of the above values which are automatically imported
+ defaultIncludes = Sets.newHashSet(
+ "String",
+ "bool",
+ "int",
+ "num",
+ "double",
+ "List",
+ "Set",
+ "Map",
+ "DateTime",
+ "Object"
+ );
+
+ imports.put("String", "dart:core");
+ imports.put("bool", "dart:core");
+ imports.put("int", "dart:core");
+ imports.put("num", "dart:core");
+ imports.put("double", "dart:core");
+ imports.put("List", "dart:core");
+ imports.put("Set", "dart:core");
+ imports.put("Map", "dart:core");
+ imports.put("DateTime", "dart:core");
+ imports.put("Object", "dart:core");
+ imports.put("MultipartFile", "package:http/http.dart");
+
+ addOption(PUB_LIBRARY, "Library name in generated code", pubLibrary);
+ addOption(PUB_NAME, "Name in generated pubspec", pubName);
+ addOption(PUB_VERSION, "Version in generated pubspec", pubVersion);
+ addOption(PUB_DESCRIPTION, "Description in generated pubspec", pubDescription);
+ addOption(PUB_AUTHOR, "Author name in generated pubspec", pubAuthor);
+ addOption(PUB_AUTHOR_EMAIL, "Email address of the author in generated pubspec", pubAuthorEmail);
+ addOption(PUB_HOMEPAGE, "Homepage in generated pubspec", pubHomepage);
+ addOption(PUB_REPOSITORY, "Repository in generated pubspec", pubRepository);
+ addOption(PUB_PUBLISH_TO, "Publish_to in generated pubspec", pubPublishTo);
+ addOption(USE_ENUM_EXTENSION, "Allow the 'x-enum-values' extension for enums", String.valueOf(useEnumExtension));
+ addOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC, sourceFolder);
+ }
+
+ @Override
+ public CodegenType getTag() {
+ return CodegenType.CLIENT;
+ }
+
+ @Override
+ public String getName() {
+ return "dart";
+ }
+
+ @Override
+ public String getHelp() {
+ return "Generates a Dart 2.x client library.";
+ }
+
+ @Override
+ public void processOpts() {
+ super.processOpts();
+
+ // Fix a couple Java notation properties
+ modelPackage = modelPackage.replace('.', '/');
+ apiPackage = apiPackage.replace('.', '/');
+ // And overwrite them in the additional properties
+ additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage);
+ additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
+
+ if (StringUtils.isEmpty(System.getenv("DART_POST_PROCESS_FILE"))) {
+ LOGGER.info("Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)");
+ LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
+ }
+
+ if (additionalProperties.containsKey(PUB_NAME)) {
+ this.setPubName((String) additionalProperties.get(PUB_NAME));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_NAME, pubName);
+ }
+
+ if (additionalProperties.containsKey(PUB_LIBRARY)) {
+ this.setPubLibrary((String) additionalProperties.get(PUB_LIBRARY));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_LIBRARY, pubLibrary);
+ }
+
+ if (additionalProperties.containsKey(PUB_VERSION)) {
+ this.setPubVersion((String) additionalProperties.get(PUB_VERSION));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_VERSION, pubVersion);
+ }
+
+ if (additionalProperties.containsKey(PUB_DESCRIPTION)) {
+ this.setPubDescription((String) additionalProperties.get(PUB_DESCRIPTION));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_DESCRIPTION, pubDescription);
+ }
+
+ if (additionalProperties.containsKey(PUB_AUTHOR)) {
+ this.setPubAuthor((String) additionalProperties.get(PUB_AUTHOR));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_AUTHOR, pubAuthor);
+ }
+
+ if (additionalProperties.containsKey(PUB_AUTHOR_EMAIL)) {
+ this.setPubAuthorEmail((String) additionalProperties.get(PUB_AUTHOR_EMAIL));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_AUTHOR_EMAIL, pubAuthorEmail);
+ }
+
+ if (additionalProperties.containsKey(PUB_HOMEPAGE)) {
+ this.setPubHomepage((String) additionalProperties.get(PUB_HOMEPAGE));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_HOMEPAGE, pubHomepage);
+ }
+
+ if (additionalProperties.containsKey(PUB_REPOSITORY)) {
+ this.setPubRepository((String) additionalProperties.get(PUB_REPOSITORY));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_REPOSITORY, pubRepository);
+ }
+
+ if (additionalProperties.containsKey(PUB_PUBLISH_TO)) {
+ this.setPubPublishTo((String) additionalProperties.get(PUB_PUBLISH_TO));
+ } else {
+ //not set, use to be passed to template
+ additionalProperties.put(PUB_PUBLISH_TO, pubPublishTo);
+ }
+
+ if (additionalProperties.containsKey(USE_ENUM_EXTENSION)) {
+ this.setUseEnumExtension(convertPropertyToBooleanAndWriteBack(USE_ENUM_EXTENSION));
+ } else {
+ // Not set, use to be passed to template.
+ additionalProperties.put(USE_ENUM_EXTENSION, useEnumExtension);
+ }
+
+ if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) {
+ String srcFolder = (String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER);
+ this.setSourceFolder(srcFolder.replace('/', File.separatorChar));
+ }
+ additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder);
+
+ // make api and model doc path available in mustache template
+ additionalProperties.put("apiDocPath", apiDocPath);
+ additionalProperties.put("modelDocPath", modelDocPath);
+
+ // check to not overwrite a custom templateDir
+ // if (templateDir == null) {
+ // embeddedTemplateDir = templateDir = "dart2";
+ // }
+ }
+
+ @Override
+ protected boolean needToImport(String type) {
+ // Import everything, unless it is from dart:core.
+ return StringUtils.isNotBlank(type) && (!imports.containsKey(type) || !imports.get(type).equals("dart:core"));
+ }
+
+ @Override
+ protected boolean isReservedWord(String word) {
+ // consider everything as reserved that is
+ // * a keyword
+ // * a word that has been mapped in the reservedWordsMappings
+ // * a default included type or a type include through some library
+ return super.isReservedWord(word) || reservedWordsMappings().containsKey(word) || defaultIncludes().contains(word);
+ }
+
+ @Override
+ public String escapeReservedWord(String name) {
+ if (reservedWordsMappings().containsKey(name)) {
+ return reservedWordsMappings().get(name);
+ }
+ return name + "_";
+ }
+
+ @Override
+ public String apiFileFolder() {
+ return (outputFolder + File.separator + libPath + sourceFolder + File.separator + apiPackage()).replace('/', File.separatorChar);
+ }
+
+ @Override
+ public String modelFileFolder() {
+ return (outputFolder + File.separator + libPath + sourceFolder + File.separator + modelPackage()).replace('/', File.separatorChar);
+ }
+
+ @Override
+ public String apiTestFileFolder() {
+ return outputFolder + File.separator + apiTestPath;
+ }
+
+ @Override
+ public String modelTestFileFolder() {
+ return outputFolder + File.separator + modelTestPath;
+ }
+
+ @Override
+ public String apiDocFileFolder() {
+ return outputFolder + File.separator + apiDocPath;
+ }
+
+ @Override
+ public String modelDocFileFolder() {
+ return outputFolder + File.separator + modelDocPath;
+ }
+
+ @Override
+ public String toVarName(String name) {
+ // replace - with _ e.g. created-at => created_at
+ name = name.replace("-", "_");
+
+ // always need to replace leading underscores first
+ name = name.replaceAll("^_", "");
+
+ // if it's all upper case, do nothing
+ if (name.matches("^[A-Z_]*$")) {
+ return name;
+ }
+
+ // replace all characters that have a mapping but ignore underscores
+ // append an underscore to each replacement so that it can be camelized
+ if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) {
+ name = escape(name, specialCharReplacements, Collections.singletonList("_"), "_");
+ }
+ // remove the rest
+ name = sanitizeName(name);
+
+ // camelize (lower first character) the variable name
+ // pet_id => petId
+ name = camelize(name, LOWERCASE_FIRST_LETTER);
+
+ if (name.matches("^\\d.*")) {
+ name = "n" + name;
+ }
+
+ if (isReservedWord(name)) {
+ name = escapeReservedWord(name);
+ }
+
+ return name;
+ }
+
+ @Override
+ public String toParamName(String name) {
+ // should be the same as variable name
+ return toVarName(name);
+ }
+
+ @Override
+ public String toModelName(final String name) {
+ String sanitizedName = sanitizeName(name);
+
+ if (!StringUtils.isEmpty(modelNamePrefix)) {
+ // add '_' so that model name can be camelized correctly
+ sanitizedName = modelNamePrefix + "_" + sanitizedName;
+ }
+
+ if (!StringUtils.isEmpty(modelNameSuffix)) {
+ // add '_' so that model name can be camelized correctly
+ sanitizedName = sanitizedName + "_" + modelNameSuffix;
+ }
+
+ // camelize the model name
+ // phone_number => PhoneNumber
+ final String camelizedName = camelize(sanitizedName);
+
+ // Check if there is a mapping that can be used
+ if (typeMapping().containsKey(camelizedName)) {
+ String typeName = typeMapping().get(camelizedName);
+ if (imports.containsKey(typeName)) {
+ // Anything with an import mapping is likely
+ // generator specific and can not be used as model name.
+ final String modelName = "Model" + camelizedName;
+ LOGGER.warn("{} (existing type) cannot be used as model name. Renamed to {}", camelizedName, modelName);
+ return modelName;
+ }
+ return typeName;
+ }
+
+ // model name cannot use reserved keyword, e.g. return
+ if (isReservedWord(camelizedName)) {
+ final String modelName = "Model" + camelizedName;
+ LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", camelizedName, modelName);
+ return modelName;
+ }
+
+ // model name starts with number
+ if (camelizedName.matches("^\\d.*")) {
+ final String modelName = "Model" + camelizedName; // e.g. 200Response => Model200Response (after camelize)
+ LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name, modelName);
+ return modelName;
+ }
+
+ return camelizedName;
+ }
+
+ @Override
+ public String toModelFilename(String name) {
+ return underscore(toModelName(name));
+ }
+
+ @Override
+ public String toModelDocFilename(String name) {
+ return toModelName(name);
+ }
+
+ @Override
+ public String toApiFilename(String name) {
+ return underscore(toApiName(name));
+ }
+
+ @Override
+ public String toApiTestFilename(String name) {
+ return toApiFilename(name) + "_test";
+ }
+
+ @Override
+ public String toModelTestFilename(String name) {
+ return toModelFilename(name) + "_test";
+ }
+
+ @Override
+ public String toDefaultValue(Schema schema) {
+ if (ModelUtils.isMapSchema(schema) || ModelUtils.isSet(schema)) {
+ return "const {}";
+ }
+ if (ModelUtils.isArraySchema(schema)) {
+ return "const []";
+ }
+
+ if (schema.getDefault() != null) {
+ if (ModelUtils.isDateSchema(schema) || ModelUtils.isDateTimeSchema(schema)) {
+ // this is currently not supported and would create compile errors
+ return null;
+ }
+ if (ModelUtils.isStringSchema(schema)) {
+ return "r'" + schema.getDefault().toString().replace("'", "\\'") + "'";
+ }
+ return schema.getDefault().toString();
+ }
+ return null;
+ }
+
+ @Override
+ public String getTypeDeclaration(Schema p) {
+ Schema> schema = unaliasSchema(p);
+ Schema> target = ModelUtils.isGenerateAliasAsModel() ? p : schema;
+ if (ModelUtils.isArraySchema(target)) {
+ Schema> items = getSchemaItems((ArraySchema) schema);
+ return getSchemaType(target) + "<" + getTypeDeclaration(items) + ">";
+ }
+ if (ModelUtils.isMapSchema(target)) {
+ // Note: ModelUtils.isMapSchema(p) returns true when p is a composed schema that also defines
+ // additionalproperties: true
+ Schema> inner = ModelUtils.getAdditionalProperties(target);
+ if (inner == null) {
+ LOGGER.error("`{}` (map property) does not have a proper inner type defined. Default to type:string", p.getName());
+ inner = new StringSchema().description("TODO default missing map inner type to string");
+ p.setAdditionalProperties(inner);
+ }
+ return getSchemaType(target) + "";
+ }
+ return super.getTypeDeclaration(p);
+ }
+
+ @Override
+ public String getSchemaType(Schema p) {
+ String openAPIType = super.getSchemaType(p);
+ if (openAPIType == null) {
+ LOGGER.error("No Type defined for Schema {}", p);
+ }
+ if (typeMapping().containsKey(openAPIType)) {
+ return typeMapping().get(openAPIType);
+ }
+ return toModelName(openAPIType);
+ }
+
+ @Override
+ public ModelsMap postProcessModels(ModelsMap objs) {
+ return postProcessModelsEnum(objs);
+ }
+
+ @Override
+ public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
+ super.postProcessModelProperty(model, property);
+ if (!model.isEnum && property.isEnum && property.getComposedSchemas() == null) {
+ // These are inner enums, enums which do not exist as models, just as properties.
+ // They are handled via the enum_inline template and are generated in the
+ // same file as the containing class. To prevent name clashes the inline enum classes
+ // are prefix with the classname of the containing class in the template.
+ // Here the datatypeWithEnum template variable gets updated to match that scheme.
+ // Also taking into account potential collection types e.g. List -> List
+ final String enumName = model.classname + property.enumName;
+ if (property.items != null) {
+ // inner items e.g. enums in collections, only works for one level
+ // but same is the case for DefaultCodegen
+ property.setDatatypeWithEnum(property.datatypeWithEnum.replace(property.items.datatypeWithEnum, enumName));
+ property.items.setDatatypeWithEnum(enumName);
+ property.items.setEnumName(enumName);
+ } else {
+ // plain enum property
+ property.setDatatypeWithEnum(property.datatypeWithEnum.replace(property.enumName, enumName));
+ }
+ property.setEnumName(enumName);
+ }
+ }
+
+ @Override
+ public CodegenProperty fromProperty(String name, Schema p, boolean required) {
+ final CodegenProperty property = super.fromProperty(name, p, required);
+
+ // Handle composed properties and it's NOT allOf with a single ref only
+ if (ModelUtils.isComposedSchema(p) && !(ModelUtils.isAllOf(p) && p.getAllOf().size() == 1)) {
+ ComposedSchema composed = (ComposedSchema) p;
+
+ // Count the occurrences of allOf/anyOf/oneOf with exactly one child element
+ long count = Stream.of(composed.getAllOf(), composed.getAnyOf(), composed.getOneOf())
+ .filter(list -> list != null && list.size() == 1).count();
+
+ if (count == 1) {
+ // Continue only if there is one element that matches
+ // and basically treat it as simple property.
+ Stream.of(composed.getAllOf(), composed.getAnyOf(), composed.getOneOf())
+ .filter(list -> list != null && list.size() == 1)
+ .findFirst()
+ .map(list -> list.get(0).get$ref())
+ .map(ModelUtils::getSimpleRef)
+ .map(ref -> ModelUtils.getSchemas(this.openAPI).get(ref))
+ .ifPresent(schema -> {
+ property.isEnum = schema.getEnum() != null;
+ property.isModel = true;
+ });
+
+ }
+ }
+ return property;
+ }
+
+ @Override
+ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) {
+ super.postProcessOperationsWithModels(objs, allModels);
+ OperationMap operations = objs.getOperations();
+ if (operations != null) {
+ List ops = operations.getOperation();
+ for (CodegenOperation op : ops) {
+ if (op.hasConsumes) {
+ if (!op.formParams.isEmpty() || op.isMultipart) {
+ // DefaultCodegen only sets this if the first consumes mediaType
+ // is application/x-www-form-urlencoded or multipart.
+ // Can just use the original
+ op.prioritizedContentTypes = op.consumes;
+ } else {
+ // Prioritize content types by moving application/json to the front
+ // similar to JavaCodegen
+ op.prioritizedContentTypes = prioritizeContentTypes(op.consumes);
+ String mediaType = op.prioritizedContentTypes.get(0).get("mediaType");
+ if (!DEFAULT_SUPPORTED_CONTENT_TYPES.contains(mediaType)) {
+ LOGGER.warn("The media-type '{}' for operation '{}' is not support in the Dart generators by default.", mediaType, op.path);
+ }
+ }
+ }
+ }
+ }
+ return objs;
+ }
+
+ private List> prioritizeContentTypes(List> consumes) {
+ if (consumes.size() <= 1) {
+ // no need to change any order
+ return consumes;
+ }
+
+ List> prioritizedContentTypes = new ArrayList<>(consumes.size());
+
+ List> jsonVendorMimeTypes = new ArrayList<>(consumes.size());
+ List> jsonMimeTypes = new ArrayList<>(consumes.size());
+
+ for (Map consume : consumes) {
+ String mediaType = consume.get("mediaType");
+ if (isJsonVendorMimeType(mediaType)) {
+ jsonVendorMimeTypes.add(consume);
+ } else if (isJsonMimeType(mediaType)) {
+ jsonMimeTypes.add(consume);
+ } else {
+ prioritizedContentTypes.add(consume);
+ }
+ }
+
+ prioritizedContentTypes.addAll(0, jsonMimeTypes);
+ prioritizedContentTypes.addAll(0, jsonVendorMimeTypes);
+ return prioritizedContentTypes;
+ }
+
+ @Override
+ protected void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions, String dataType) {
+ if (vendorExtensions != null && useEnumExtension && vendorExtensions.containsKey("x-enum-values")) {
+ // Use the x-enum-values extension for this enum
+ // Existing enumVars added by the default handling need to be removed first
+ enumVars.clear();
+
+ Object extension = vendorExtensions.get("x-enum-values");
+ List> values = (List>) extension;
+ for (Map value : values) {
+ Map enumVar = new HashMap<>();
+ enumVar.put("name", toEnumVarName((String) value.get("identifier"), dataType));
+ enumVar.put("value", toEnumValue(value.get("numericValue").toString(), dataType));
+ enumVar.put("isString", isDataTypeString(dataType));
+ if (value.containsKey("description")) {
+ enumVar.put("description", value.get("description").toString());
+ }
+ enumVars.add(enumVar);
+ }
+ } else {
+ super.updateEnumVarsWithExtensions(enumVars, vendorExtensions, dataType);
+ }
+ }
+
+ @Override
+ public String toEnumVarName(String value, String datatype) {
+ if (value.length() == 0) {
+ return "empty";
+ }
+ if (("number".equalsIgnoreCase(datatype) ||
+ "double".equalsIgnoreCase(datatype) ||
+ "int".equalsIgnoreCase(datatype)) &&
+ value.matches("^-?\\d.*")) {
+ // Only rename numeric values when the datatype is numeric
+ // AND the name is not changed by enum extensions (matches a numeric value).
+ boolean isNegative = value.startsWith("-");
+ return toVarName("number" + (isNegative ? "_negative" : "") + value);
+ }
+ return toVarName(value);
+ }
+
+ @Override
+ public String toEnumValue(String value, String datatype) {
+ if ("number".equalsIgnoreCase(datatype) ||
+ "int".equalsIgnoreCase(datatype)) {
+ return value;
+ } else {
+ return "r'" + escapeText(value) + "'";
+ }
+ }
+
+ @Override
+ public String toOperationId(String operationId) {
+ operationId = super.toOperationId(operationId);
+
+ operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER);
+
+ // method name cannot use reserved keyword, e.g. return
+ if (isReservedWord(operationId)) {
+ String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER);
+ LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
+ return newOperationId;
+ }
+
+ // operationId starts with a number
+ if (operationId.matches("^\\d.*")) {
+ String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER);
+ LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId);
+ operationId = newOperationId;
+ }
+
+ return operationId;
+ }
+
+ public void setPubLibrary(String pubLibrary) {
+ this.pubLibrary = pubLibrary;
+ }
+
+ public void setPubName(String pubName) {
+ this.pubName = pubName;
+ }
+
+ public void setPubVersion(String pubVersion) {
+ this.pubVersion = pubVersion;
+ }
+
+ public void setPubDescription(String pubDescription) {
+ this.pubDescription = pubDescription;
+ }
+
+ public void setPubAuthor(String pubAuthor) {
+ this.pubAuthor = pubAuthor;
+ }
+
+ public void setPubAuthorEmail(String pubAuthorEmail) {
+ this.pubAuthorEmail = pubAuthorEmail;
+ }
+
+ public void setPubHomepage(String pubHomepage) {
+ this.pubHomepage = pubHomepage;
+ }
+
+ public void setPubRepository(String pubRepository) {
+ this.pubRepository = pubRepository;
+ }
+
+ public void setPubPublishTo(String pubPublishTo) {
+ this.pubPublishTo = pubPublishTo;
+ }
+
+ public void setUseEnumExtension(boolean useEnumExtension) {
+ this.useEnumExtension = useEnumExtension;
+ }
+
+ public void setSourceFolder(String sourceFolder) {
+ this.sourceFolder = sourceFolder;
+ }
+
+ @Override
+ public String escapeQuotationMark(String input) {
+ // remove " to avoid code injection
+ return input.replace("\"", "");
+ }
+
+ @Override
+ public String escapeUnsafeCharacters(String input) {
+ return input.replace("*/", "*_/").replace("/*", "/_*");
+ }
+
+ @Override
+ public void postProcessFile(File file, String fileType) {
+ super.postProcessFile(file, fileType);
+ if (file == null) {
+ return;
+ }
+
+ String dartPostProcessFile = System.getenv("DART_POST_PROCESS_FILE");
+ if (StringUtils.isEmpty(dartPostProcessFile)) {
+ return; // skip if DART_POST_PROCESS_FILE env variable is not defined
+ }
+
+ // process all files with dart extension
+ if ("dart".equals(FilenameUtils.getExtension(file.toString()))) {
+ // currently supported is "dartfmt -w" and "dart format"
+ String command = dartPostProcessFile + " " + file;
+ try {
+ Process p = Runtime.getRuntime().exec(command);
+ int exitValue = p.waitFor();
+ if (exitValue != 0) {
+ LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
+ } else {
+ LOGGER.info("Successfully executed: {}", command);
+ }
+ } catch (InterruptedException | IOException e) {
+ LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
+ // Restore interrupted state
+ Thread.currentThread().interrupt();
+ }
+ }
+ }
+
+ @Override
+ public GeneratorLanguage generatorLanguage() {
+ return GeneratorLanguage.DART;
+ }
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java
new file mode 100644
index 000000000000..b1bca5e5fac5
--- /dev/null
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java
@@ -0,0 +1,1049 @@
+package org.openapitools.codegen.languages;
+
+import static org.openapitools.codegen.utils.StringUtils.underscore;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.openapitools.codegen.CliOption;
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.CodegenDiscriminator;
+import org.openapitools.codegen.CodegenDiscriminator.MappedModel;
+import org.openapitools.codegen.CodegenModel;
+import org.openapitools.codegen.CodegenOperation;
+import org.openapitools.codegen.CodegenParameter;
+import org.openapitools.codegen.CodegenProperty;
+import org.openapitools.codegen.SupportingFile;
+import org.openapitools.codegen.TemplateManager;
+import org.openapitools.codegen.api.TemplatePathLocator;
+import org.openapitools.codegen.config.GlobalSettings;
+import org.openapitools.codegen.meta.GeneratorMetadata;
+import org.openapitools.codegen.meta.Stability;
+import org.openapitools.codegen.meta.features.ClientModificationFeature;
+import org.openapitools.codegen.meta.features.SchemaSupportFeature;
+import org.openapitools.codegen.model.ModelMap;
+import org.openapitools.codegen.model.ModelsMap;
+import org.openapitools.codegen.model.OperationMap;
+import org.openapitools.codegen.model.OperationsMap;
+import org.openapitools.codegen.templating.CommonTemplateContentLocator;
+import org.openapitools.codegen.templating.GeneratorTemplateContentLocator;
+import org.openapitools.codegen.templating.MustacheEngineAdapter;
+import org.openapitools.codegen.templating.TemplateManagerOptions;
+import org.openapitools.codegen.utils.ModelUtils;
+import org.openapitools.codegen.utils.ProcessUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Sets;
+import com.samskivert.mustache.Mustache;
+import com.samskivert.mustache.Template;
+
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.media.Discriminator;
+import io.swagger.v3.oas.models.media.Schema;
+
+
+
+/*
+ * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class DartNextClientCodegen extends DartNextAbstractCodegen {
+
+ private final Logger LOGGER = LoggerFactory.getLogger(DartDioClientCodegen.class);
+
+ public static final String DATE_LIBRARY = "dateLibrary";
+ public static final String DATE_LIBRARY_CORE = "core";
+ public static final String DATE_LIBRARY_TIME_MACHINE = "timemachine";
+ public static final String DATE_LIBRARY_DEFAULT = DATE_LIBRARY_CORE;
+
+ public static final String SERIALIZATION_LIBRARY_BUILT_VALUE = "built_value";
+ public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable";
+ public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE;
+
+ public static final String NETWORKING_LIBRARY_DIO = "dio";
+ public static final String NETWORKING_LIBRARY_HTTP = "http";
+ public static final String NETWORKING_LIBRARY_DEFAULT = NETWORKING_LIBRARY_DIO;
+
+ private static final String DIO_IMPORT = "package:dio/dio.dart";
+ public static final String FINAL_PROPERTIES = "finalProperties";
+ public static final String FINAL_PROPERTIES_DEFAULT_VALUE = "true";
+
+ private static final String CLIENT_NAME = "clientName";
+
+ private String dateLibrary;
+
+ private String serializationLibrary;
+
+ private String clientName;
+
+ private TemplateManager templateManager;
+
+ private final Map supportedSerializationLibraries = new LinkedHashMap<>();
+
+ public DartNextClientCodegen() {
+ super();
+
+ modifyFeatureSet(features -> features
+ .includeClientModificationFeatures(
+ ClientModificationFeature.Authorizations,
+ ClientModificationFeature.UserAgent)
+ .includeSchemaSupportFeatures(
+ SchemaSupportFeature.Polymorphism,
+ SchemaSupportFeature.Union,
+ SchemaSupportFeature.Composite,
+ SchemaSupportFeature.allOf,
+ SchemaSupportFeature.oneOf,
+ SchemaSupportFeature.anyOf));
+ generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
+ .stability(Stability.EXPERIMENTAL)
+ .build();
+
+ outputFolder = "generated-code/dart-next";
+ embeddedTemplateDir = "dart-next";
+ this.setTemplateDir(embeddedTemplateDir);
+
+ supportedLibraries.put(NETWORKING_LIBRARY_DIO, "[DEFAULT] dio");
+ supportedLibraries.put(NETWORKING_LIBRARY_HTTP, "[BETA] http");
+ final CliOption networkingLibraryOptions = CliOption.newString(CodegenConstants.LIBRARY,
+ "Specify networking library");
+ networkingLibraryOptions.setEnum(supportedLibraries);
+ networkingLibraryOptions.setDefault(NETWORKING_LIBRARY_DEFAULT);
+ cliOptions.add(networkingLibraryOptions);
+
+ supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value");
+ supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable");
+ final CliOption serializationLibraryOptions = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY,
+ "Specify serialization library");
+ serializationLibraryOptions.setEnum(supportedSerializationLibraries);
+ serializationLibraryOptions.setDefault(SERIALIZATION_LIBRARY_DEFAULT);
+ cliOptions.add(serializationLibraryOptions);
+
+ // Date Library Option
+ final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library");
+ dateOption.setDefault(DATE_LIBRARY_DEFAULT);
+
+ final CliOption finalProperties = CliOption.newBoolean(FINAL_PROPERTIES,
+ "Whether properties are marked as final when using Json Serializable for serialization");
+ finalProperties.setDefault(FINAL_PROPERTIES_DEFAULT_VALUE);
+ cliOptions.add(finalProperties);
+
+ final Map dateOptions = new HashMap<>();
+ dateOptions.put(DATE_LIBRARY_CORE, "[DEFAULT] Dart core library (DateTime)");
+ dateOptions.put(DATE_LIBRARY_TIME_MACHINE,
+ "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.");
+ dateOption.setEnum(dateOptions);
+ cliOptions.add(dateOption);
+ }
+
+ public String getDateLibrary() {
+ return dateLibrary;
+ }
+
+ public void setDateLibrary(String library) {
+ this.dateLibrary = library;
+ }
+
+ public String getSerializationLibrary() {
+ return serializationLibrary;
+ }
+
+ /**
+ * Set serialization library template.
+ *
+ * @param serializationLibrary Serialization Library template
+ */
+ public void setSerializationLibrary(String serializationLibrary) {
+ if (serializationLibrary != null && !supportedSerializationLibraries.containsKey(serializationLibrary)) {
+ StringBuilder sb = new StringBuilder(
+ "Unknown serialization library: " + serializationLibrary + "\nAvailable serialization libraries:");
+ if (supportedSerializationLibraries.size() == 0) {
+ sb.append("\n ").append("NONE");
+ } else {
+ for (String lib : supportedSerializationLibraries.keySet()) {
+ sb.append("\n ").append(lib);
+ }
+ }
+ throw new RuntimeException(sb.toString());
+ }
+ this.serializationLibrary = serializationLibrary;
+ }
+
+ public String getClientName() {
+ return clientName;
+ }
+
+ public void setClientName(String clientName) {
+ this.clientName = clientName;
+ }
+
+ @Override
+ public String getName() {
+ return "dart-next";
+ }
+
+ @Override
+ public String getHelp() {
+ return "Generates a Dart client library.";
+ }
+
+ @Override
+ public void processOpts() {
+ super.processOpts();
+
+ if (StringUtils.isEmpty(System.getenv("DART_POST_PROCESS_FILE"))) {
+ LOGGER.info(
+ "Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)");
+ LOGGER.info(
+ "NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
+ }
+
+ if (!additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
+ additionalProperties.put(CodegenConstants.LIBRARY, NETWORKING_LIBRARY_DEFAULT);
+ LOGGER.debug("Networking library not set, using default {}", NETWORKING_LIBRARY_DEFAULT);
+ }
+ setLibrary(additionalProperties.get(CodegenConstants.LIBRARY).toString());
+
+ if (!additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) {
+ additionalProperties.put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DEFAULT);
+ LOGGER.debug("Serialization library not set, using default {}", SERIALIZATION_LIBRARY_DEFAULT);
+ }
+ setSerializationLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString());
+ if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) {
+ this.setLegacyDiscriminatorBehavior(false);
+ }
+
+ if (!additionalProperties.containsKey(DATE_LIBRARY)) {
+ additionalProperties.put(DATE_LIBRARY, DATE_LIBRARY_DEFAULT);
+ LOGGER.debug("Date library not set, using default {}", DATE_LIBRARY_DEFAULT);
+ }
+ setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString());
+
+ if (!additionalProperties.containsKey(FINAL_PROPERTIES)) {
+ additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(FINAL_PROPERTIES_DEFAULT_VALUE));
+ LOGGER.debug("finalProperties not set, using default {}", FINAL_PROPERTIES_DEFAULT_VALUE);
+ } else {
+ additionalProperties.put(FINAL_PROPERTIES,
+ Boolean.parseBoolean(additionalProperties.get(FINAL_PROPERTIES).toString()));
+ }
+
+ if (!additionalProperties.containsKey(CLIENT_NAME)) {
+ final String name = org.openapitools.codegen.utils.StringUtils.camelize(pubName);
+ additionalProperties.put(CLIENT_NAME, name);
+ LOGGER.debug("Client name not set, using default {}", DATE_LIBRARY_DEFAULT);
+ }
+ setClientName(additionalProperties.get(CLIENT_NAME).toString());
+
+ supportingFiles.add(new SupportingFile("pubspec.mustache", "", "pubspec.yaml"));
+ supportingFiles.add(new SupportingFile("analysis_options.mustache", "", "analysis_options.yaml"));
+ supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
+ supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
+
+ supportingFiles.add(new SupportingFile("lib_api_exports.mustache", libPath, "apis.dart"));
+ supportingFiles.add(new SupportingFile("lib_model_exports.mustache", libPath, "models.dart"));
+ supportingFiles.add(new SupportingFile("lib.mustache", libPath, pubName + ".dart"));
+
+ final String srcFolder = libPath + sourceFolder;
+ supportingFiles
+ .add(new SupportingFile("serialization/repository_base.mustache", srcFolder, "repository_base.dart"));
+
+ configureNetworkingLibrary(srcFolder);
+ configureSerializationLibrary(srcFolder);
+ configureDateLibrary(srcFolder);
+ }
+
+ private void configureNetworkingLibrary(String sourceFolder) {
+ switch (library) {
+ case NETWORKING_LIBRARY_DIO:
+ additionalProperties.put("useDio", "true");
+ configureNetworkingLibraryDio(sourceFolder);
+ break;
+ default:
+ case NETWORKING_LIBRARY_HTTP:
+ additionalProperties.put("useHttp", "true");
+ configureNetworkingLibraryHttp(sourceFolder);
+ break;
+ }
+
+ TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(),
+ isSkipOverwrite());
+ TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator();
+ TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this);
+ templateManager = new TemplateManager(
+ templateManagerOptions,
+ getTemplatingEngine(),
+ new TemplatePathLocator[] { generatorTemplateLocator, commonTemplateLocator });
+
+ // A lambda which allows for easy includes of serialization library specific
+ // templates without having to change the main template files.
+ additionalProperties.put("includeLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> {
+ MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine());
+ String templateFile = "libraries/" + library + "/" + fragment.execute() + ".mustache";
+ Template tmpl = engine.getCompiler()
+ .withLoader(name -> engine.findTemplate(templateManager, name))
+ .defaultValue("")
+ .compile(templateManager.getFullTemplateContents(templateFile));
+
+ fragment.executeTemplate(tmpl, writer);
+ });
+ }
+
+ private void configureNetworkingLibraryDio(String srcFolder) {
+ imports.put("MultipartFile", DIO_IMPORT);
+ final String dioMustacheFolder = "libraries/dio/";
+ supportingFiles
+ .add(new SupportingFile(dioMustacheFolder + "api_client.mustache", srcFolder, "api_client.dart"));
+ supportingFiles.add(new SupportingFile(dioMustacheFolder + "api_util.mustache", srcFolder, "api_util.dart"));
+ final String authFolder = srcFolder + File.separator + "auth";
+ final String authMustacheFolder = dioMustacheFolder + "auth/";
+ supportingFiles
+ .add(new SupportingFile(authMustacheFolder + "auth_exports.mustache", authFolder, "_exports.dart"));
+ supportingFiles
+ .add(new SupportingFile(authMustacheFolder + "api_key_auth.mustache", authFolder, "api_key_auth.dart"));
+ supportingFiles
+ .add(new SupportingFile(authMustacheFolder + "basic_auth.mustache", authFolder, "basic_auth.dart"));
+ supportingFiles
+ .add(new SupportingFile(authMustacheFolder + "bearer_auth.mustache", authFolder, "bearer_auth.dart"));
+ supportingFiles.add(new SupportingFile(authMustacheFolder + "oauth.mustache", authFolder, "oauth.dart"));
+ supportingFiles.add(new SupportingFile(authMustacheFolder + "auth.mustache", authFolder, "auth.dart"));
+ }
+
+ private void configureNetworkingLibraryHttp(String srcFolder) {
+
+ }
+
+ private void configureSerializationLibrary(String srcFolder) {
+ switch (serializationLibrary) {
+ case SERIALIZATION_LIBRARY_JSON_SERIALIZABLE:
+ additionalProperties.put("useJsonSerializable", "true");
+ configureSerializationLibraryJsonSerializable(srcFolder);
+ break;
+ default:
+ case SERIALIZATION_LIBRARY_BUILT_VALUE:
+ additionalProperties.put("useBuiltValue", "true");
+ configureSerializationLibraryBuiltValue(srcFolder);
+ break;
+ }
+
+ TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(),
+ isSkipOverwrite());
+ TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator();
+ TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this);
+ templateManager = new TemplateManager(
+ templateManagerOptions,
+ getTemplatingEngine(),
+ new TemplatePathLocator[] { generatorTemplateLocator, commonTemplateLocator });
+
+ // A lambda which allows for easy includes of serialization library specific
+ // templates without having to change the main template files.
+ additionalProperties.put("includeSerializationTemplate", (Mustache.Lambda) (fragment, writer) -> {
+ MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine());
+ String templateFile = "serialization/" + serializationLibrary + "/" + fragment.execute() + ".mustache";
+ Template tmpl = engine.getCompiler()
+ .withLoader(name -> engine.findTemplate(templateManager, name))
+ .defaultValue("")
+ .compile(templateManager.getFullTemplateContents(templateFile));
+
+ fragment.executeTemplate(tmpl, writer);
+ });
+ }
+
+ private void configureSerializationLibraryBuiltValue(String srcFolder) {
+ supportingFiles.add(new SupportingFile("serialization/built_value/repository_impl.mustache", srcFolder,
+ "repository_impl.dart"));
+ supportingFiles.add(
+ new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart"));
+
+ typeMapping.put("Array", "BuiltList");
+ typeMapping.put("array", "BuiltList");
+ typeMapping.put("List", "BuiltList");
+ typeMapping.put("set", "BuiltSet");
+ typeMapping.put("map", "BuiltMap");
+ typeMapping.put("file", "Uint8List");
+ typeMapping.put("binary", "Uint8List");
+ typeMapping.put("object", "JsonObject");
+ typeMapping.put("AnyType", "JsonObject");
+
+ imports.put("BuiltList", "package:built_collection/built_collection.dart");
+ imports.put("BuiltSet", "package:built_collection/built_collection.dart");
+ imports.put("BuiltMap", "package:built_collection/built_collection.dart");
+ imports.put("JsonObject", "package:built_value/json_object.dart");
+ imports.put("Uint8List", "dart:typed_data");
+ }
+
+ private void configureSerializationLibraryJsonSerializable(String srcFolder) {
+ supportingFiles.add(new SupportingFile("serialization/json_serializable/repository_impl.mustache", srcFolder,
+ "repository_impl.dart"));
+ supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache",
+ "" /* main project dir */, "build.yaml"));
+
+ // most of these are defined in AbstractDartCodegen, we are overriding
+ // just the binary / file handling
+ languageSpecificPrimitives.add("Object");
+ imports.put("Uint8List", "dart:typed_data");
+ }
+
+ private void configureDateLibrary(String srcFolder) {
+ switch (dateLibrary) {
+ case DATE_LIBRARY_TIME_MACHINE:
+ additionalProperties.put("useDateLibTimeMachine", "true");
+ typeMapping.put("date", "OffsetDate");
+ typeMapping.put("Date", "OffsetDate");
+ typeMapping.put("DateTime", "OffsetDateTime");
+ typeMapping.put("datetime", "OffsetDateTime");
+ imports.put("OffsetDate", "package:time_machine/time_machine.dart");
+ imports.put("OffsetDateTime", "package:time_machine/time_machine.dart");
+ if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) {
+ supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache",
+ srcFolder, "local_date_serializer.dart"));
+ }
+ break;
+ default:
+ case DATE_LIBRARY_CORE:
+ additionalProperties.put("useDateLibCore", "true");
+ if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) {
+ typeMapping.put("date", "Date");
+ typeMapping.put("Date", "Date");
+ importMapping.put("Date",
+ "package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/date.dart");
+ supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache",
+ srcFolder + File.separator + modelPackage(), "date.dart"));
+ supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache",
+ srcFolder, "date_serializer.dart"));
+ }
+ break;
+ }
+ }
+
+ @Override
+ public String toDefaultValue(Schema schema) {
+ if (schema.getDefault() != null) {
+ if (schema.getEnum() != null) {
+ return super.toDefaultValue(schema);
+ }
+ if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) {
+ if (ModelUtils.isArraySchema(schema)) {
+ if (ModelUtils.isSet(schema)) {
+ return "SetBuilder()";
+ }
+ return "ListBuilder()";
+ }
+ if (ModelUtils.isMapSchema(schema)) {
+ return "MapBuilder()";
+ }
+ }
+
+ if (ModelUtils.isDateSchema(schema) || ModelUtils.isDateTimeSchema(schema)) {
+ // this is currently not supported and would create compile errors
+ return null;
+ }
+ if (ModelUtils.isStringSchema(schema)) {
+ return "'" + schema.getDefault().toString().replaceAll("'", "\\'") + "'";
+ }
+ return schema.getDefault().toString();
+ }
+ return null;
+ }
+
+ @Override
+ public String toDefaultParameterValue(Schema> schema) {
+ var result = super.toDefaultParameterValue(schema);
+ return result;
+ }
+
+ @Override
+ public void updateCodegenPropertyEnum(CodegenProperty var) {
+ super.updateCodegenPropertyEnum(var);
+ var enumName = var.getEnumName();
+ if (enumName != null) {
+ if (var.defaultValue != null) {
+ var allowable = var.getAllowableValues();
+ if (allowable != null) {
+ var matchingMap = (ArrayList>) allowable.get("enumVars");
+ String matchingName = null;
+ for (Object enumMember : matchingMap) {
+ if (!(enumMember instanceof HashMap, ?>)) {
+ continue;
+ }
+ var castedEnumMember = (HashMap) enumMember;
+ var name = (String) castedEnumMember.get("name");
+ var value = castedEnumMember.get("value");
+ if (value.equals(var.defaultValue)) {
+ matchingName = name;
+ break;
+ }
+ }
+ if (matchingName != null) {
+ var newDefaultValue = enumName + "." + matchingName;
+ var oldDefaultValue = var.getDefaultValue();
+ LOGGER.info("Modifying enum {} with default value {} to {}", enumName, oldDefaultValue,
+ newDefaultValue);
+ var.setDefaultValue(newDefaultValue);
+ }
+ }
+
+ }
+ }
+ }
+
+
+ @Override
+ public ModelsMap postProcessModels(ModelsMap objs) {
+ objs = super.postProcessModels(objs);
+ List models = objs.getModels();
+ ProcessUtils.addIndexToProperties(models, 1);
+ return objs;
+ }
+
+ /// Gets all ancestors of a given model, and puts it in accumulator
+ private void getAncestors(CodegenModel cm, Map allModels, Set accumulator) {
+
+ // get direct parents
+ Set directParentNames = cm.allOf;
+ if (directParentNames != null && !directParentNames.isEmpty()) {
+ for (String directParentName : directParentNames) {
+ if (accumulator.add(directParentName)) {
+ CodegenModel parent = allModels.get(directParentName);
+ getAncestors(parent, allModels, accumulator);
+ }
+ }
+ }
+ }
+
+ private void syncRootTypesWithInnerVars(Map objs) {
+ Map allModels = new HashMap<>();
+ for (ModelsMap modelsEntries : objs.values()) {
+ for (ModelMap modelsMap : modelsEntries.getModels()) {
+ CodegenModel model = modelsMap.getModel();
+ allModels.put(model.getClassname(), model);
+ }
+ }
+
+ for (CodegenModel model : allModels.values()) {
+ syncRootTypesWithInnerVars(allModels, model);
+ }
+ }
+
+ @Override
+ public CodegenProperty fromProperty(String name, Schema p, boolean required,
+ boolean schemaIsFromAdditionalProperties) {
+ CodegenProperty result = super.fromProperty(name, p, required, schemaIsFromAdditionalProperties);
+ if (result.containerType != null && typeMapping.containsKey(result.containerType)) {
+ result.containerType = typeMapping.get(result.containerType);
+ }
+ return result;
+ }
+
+ private void syncRootTypesWithInnerVars(Map objs, CodegenModel model) {
+ List allVars = new ArrayList<>();
+ allVars.addAll(((Collection) model.vendorExtensions.get(kSelfAndAncestorOnlyProps)));
+ allVars.addAll(((Collection) model.vendorExtensions.get(kSelfOnlyProps)));
+ allVars.addAll(((Collection) model.vendorExtensions.get(kAncestorOnlyProps)));
+
+ for (CodegenProperty prop : allVars) {
+ // check if type exists in parent map
+ String type = prop.openApiType;
+ if (objs.containsKey(type)) {
+ // get the type
+ CodegenModel relatedModel = objs.get(type);
+ // fill the property's VendorExtensions with the type's VendorExtensions
+ prop.getVendorExtensions().put(kIsParent, relatedModel.getVendorExtensions().get(kIsParent));
+ prop.isEnum = relatedModel.isEnum;
+
+ }
+ }
+ }
+
+ private final String kIsChild = "x-is-child";
+ private final String kIsParent = "x-is-parent";
+ private final String kIsPure = "x-is-pure";
+ private final String kSelfOnlyProps = "x-self-only-props";
+ private final String kHasSelfOnlyProps = "x-has-self-only-props";
+ private final String kAncestorOnlyProps = "x-ancestor-only-props";
+ private final String kHasAncestorOnlyProps = "x-has-ancestor-only-props";
+ private final String kSelfAndAncestorOnlyProps = "x-self-and-ancestor-only-props";
+ private final String kHasSelfAndAncestorOnlyProps = "x-has-self-and-ancestor-only-props";
+ private final String kParentDiscriminator = "x-parent-discriminator";
+
+ // adapts codegen models and property to dart rules of inheritance
+ private void adaptToDartInheritance(Map objs) {
+ // get all models
+ Map allModels = new HashMap<>();
+ for (ModelsMap modelsEntries : objs.values()) {
+ for (ModelMap modelsMap : modelsEntries.getModels()) {
+ CodegenModel model = modelsMap.getModel();
+ allModels.put(model.getClassname(), model);
+ }
+ }
+
+ // all ancestors
+ Set allAncestorsForAllModelsFlat = new HashSet<>();
+ // maps a model to its ancestors
+ Map> allAncestorsForAllModels = new HashMap<>();
+ for (java.util.Map.Entry cm : allModels.entrySet()) {
+ Set allAncestors = new HashSet<>();
+ // get all ancestors
+ // TODO: optimize this logic ?
+ getAncestors(cm.getValue(), allModels, allAncestors);
+ // just in case, a model can't be its own ancestor
+ allAncestors.remove(cm.getKey());
+
+ allAncestorsForAllModels.put(cm.getKey(), allAncestors);
+ allAncestorsForAllModelsFlat.addAll(allAncestors);
+ }
+
+ Set allPureClasses = new HashSet<>();
+ // set isChild,isParent,isPure
+ for (java.util.Map.Entry cmEntry : allModels.entrySet()) {
+ String key = cmEntry.getKey();
+ CodegenModel cm = cmEntry.getValue();
+ // get all ancestors
+ Set allAncestors = allAncestorsForAllModels.get(key);
+
+ // a class is a parent when it's an ancestor to another class
+ boolean isParent = allAncestorsForAllModelsFlat.contains(key);
+ // a class is a child when it has any ancestor
+ boolean isChild = !allAncestors.isEmpty();
+ // a class is pure when it's not a child, and has no oneOf nor anyOf
+ boolean isPure = !isChild && (cm.oneOf == null || cm.oneOf.isEmpty())
+ && (cm.anyOf == null || cm.anyOf.isEmpty());
+
+ cm.vendorExtensions.put(kIsChild, isChild);
+ cm.vendorExtensions.put(kIsParent, isParent);
+ cm.vendorExtensions.put(kIsPure, isPure);
+ if (!isParent && (cm.oneOf == null || cm.oneOf.isEmpty())) {
+ // discriminator has no meaning here
+ if (cm.discriminator != null) {
+ cm.vendorExtensions.put(kParentDiscriminator, cm.discriminator);
+ cm.discriminator = null;
+ }
+
+ }
+ // when pure:
+ // vars = allVars = selfOnlyProperties = kSelfAndAncestorOnlyProps
+ // ancestorOnlyProps = empty
+ if (isPure) {
+ cm.vendorExtensions.put(kSelfOnlyProps, new ArrayList<>(cm.getVars()));
+ cm.vendorExtensions.put(kHasSelfOnlyProps, !cm.getVars().isEmpty());
+ cm.vendorExtensions.put(kAncestorOnlyProps, new ArrayList());
+ cm.vendorExtensions.put(kHasAncestorOnlyProps, false);
+ cm.vendorExtensions.put(kSelfAndAncestorOnlyProps, new ArrayList<>(cm.getVars()));
+ cm.vendorExtensions.put(kHasSelfAndAncestorOnlyProps, !cm.getVars().isEmpty());
+
+ allPureClasses.add(key);
+ }
+ }
+
+ // handle impure models
+ for (java.util.Map.Entry cmEntry : allModels.entrySet()) {
+ String key = cmEntry.getKey();
+ CodegenModel cm = cmEntry.getValue();
+ if (allPureClasses.contains(key)) {
+ continue;
+ }
+ // get all ancestors
+ Set allAncestors = allAncestorsForAllModels.get(key);
+
+ // get direct parents
+ // Set directParentNames = cm.allOf == null ? new HashSet<>() :
+ // cm.allOf;
+ Set compositeProperties = new HashSet<>();
+
+ Set compositeModelNames = new HashSet();
+ compositeModelNames.addAll(ObjectUtils.firstNonNull(cm.oneOf, new HashSet<>()));
+ compositeModelNames.addAll(ObjectUtils.firstNonNull(cm.anyOf, new HashSet<>()));
+ compositeModelNames.addAll(allAncestors);
+
+ for (String compositeModelName : compositeModelNames) {
+ CodegenModel model = allModels.get(compositeModelName);
+ if (model == null)
+ continue;
+ List allVars = ObjectUtils.firstNonNull(model.getAllVars(), new ArrayList<>());
+ for (CodegenProperty prop : allVars) {
+ compositeProperties.add(prop.getName());
+ }
+ }
+ // dart classes declare selfOnlyProperties as direct members (they exist in
+ // "vars")
+ // for pure models, this will equal vars
+ Map selfOnlyProperties = new HashMap<>();
+
+ // ancestorOnlyProperties are properties defined by all ancestors
+ // NOTE: oneOf,anyOf are NOT considered ancestors
+ // since a child in dart must implement ALL OF the parent (using implements)
+ Map ancestorOnlyProperties = new HashMap<>();
+
+ // combines both selfOnlyProperties and ancestorOnlyProperties
+ // this will be used by the custom serializer as "x-handled-vars" and
+ // "x-has-handled-vars"
+ Map selfAndAncestorOnlyProperties = new HashMap<>();
+
+ // STEP 1: calculating selfOnlyProperties
+ // get all vars of all ancestors and add them to ancestorPropNames
+ // Set _ancestorPropNames = new HashSet<>();
+ for (String ancestorKey : allAncestors) {
+ CodegenModel ancestorCM = allModels.get(ancestorKey);
+ for (CodegenProperty prop : ancestorCM.getVars()) {
+ ancestorOnlyProperties.put(prop.getName(), prop);
+ }
+ }
+ for (CodegenProperty p : cm.getVars()) {
+ p.isInherited = ancestorOnlyProperties.containsKey(p.getName());
+ if (!p.isInherited && !compositeProperties.contains(p.getName())) {
+ selfOnlyProperties.put(p.getName(), p);
+ }
+ }
+ selfAndAncestorOnlyProperties.putAll(selfOnlyProperties);
+ selfAndAncestorOnlyProperties.putAll(ancestorOnlyProperties);
+
+ cm.vendorExtensions.put(kSelfOnlyProps, new ArrayList<>(selfOnlyProperties.values()));
+ cm.vendorExtensions.put(kHasSelfOnlyProps, !selfOnlyProperties.isEmpty());
+ cm.vendorExtensions.put(kAncestorOnlyProps, new ArrayList<>(ancestorOnlyProperties.values()));
+ cm.vendorExtensions.put(kHasAncestorOnlyProps, !ancestorOnlyProperties.isEmpty());
+ cm.vendorExtensions.put(kSelfAndAncestorOnlyProps, new ArrayList<>(selfAndAncestorOnlyProperties.values()));
+ cm.vendorExtensions.put(kHasSelfAndAncestorOnlyProps, !selfAndAncestorOnlyProperties.isEmpty());
+ // fixes missing imports
+ Set interfaceImports = new HashSet();
+ interfaceImports.addAll(cm.allOf);
+ interfaceImports.addAll(cm.oneOf);
+ interfaceImports.addAll(cm.anyOf);
+ cm.imports.addAll(rewriteImports(interfaceImports, true));
+ }
+ }
+
+ /// override the default behavior of createDiscriminator
+ /// to remove extra mappings added as a side effect of
+ /// setLegacyDiscriminatorBehavior(false)
+ /// this ensures 1-1 schema mapping instead of 1-many
+ @Override
+ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema) {
+ CodegenDiscriminator sub = super.createDiscriminator(schemaName, schema);
+ Discriminator originalDiscriminator = schema.getDiscriminator();
+ if (originalDiscriminator != null) {
+ Map originalMapping = originalDiscriminator.getMapping();
+ if (originalMapping != null && !originalMapping.isEmpty()) {
+ // we already have a discriminator mapping, remove everything else
+ for (MappedModel currentMappings : new HashSet<>(sub.getMappedModels())) {
+ if (originalMapping.containsKey(currentMappings.getMappingName())) {
+ // all good
+ } else {
+ sub.getMapping().remove(currentMappings.getMappingName());
+ sub.getMappedModels().remove(currentMappings);
+ }
+ }
+ }
+ }
+ return sub;
+ }
+
+ @Override
+ public Map postProcessAllModels(Map objs) {
+ objs = super.postProcessAllModels(objs);
+ if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) {
+ adaptToDartInheritance(objs);
+ syncRootTypesWithInnerVars(objs);
+ }
+
+ // loop through models to update the imports
+ for (ModelsMap entry : objs.values()) {
+ for (ModelMap mo : entry.getModels()) {
+ CodegenModel cm = mo.getModel();
+ cm.imports = rewriteImports(cm.imports, true);
+ cm.vendorExtensions.put("x-has-vars", !cm.vars.isEmpty());
+ }
+ }
+
+ return objs;
+ }
+
+ @Override
+ public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
+ super.postProcessModelProperty(model, property);
+ if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) {
+ if (property.isEnum && property.getComposedSchemas() == null) {
+ // enums are generated with built_value and make use of BuiltSet
+ model.imports.add("BuiltSet");
+ }
+
+ if (property.isContainer) {
+ // Figure out if there are any container type additionalProperties
+ // that need a custom serializer builder factory added.
+ final CodegenProperty items = property.items;
+ if (items.getAdditionalProperties() != null) {
+ addBuiltValueSerializer(BuiltValueSerializer.fromCodegenProperty(items));
+ }
+ }
+ }
+ }
+
+ @Override
+ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) {
+ super.postProcessOperationsWithModels(objs, allModels);
+ OperationMap operations = objs.getOperations();
+ List operationList = operations.getOperation();
+
+ Set resultImports = new HashSet<>();
+
+ for (CodegenOperation op : operationList) {
+ for (CodegenParameter param : Stream.of(op.allParams, op.bodyParams, op.formParams)
+ .flatMap(Collection::stream)
+ .collect(Collectors.toList())) {
+ if (((op.isMultipart && param.isFormParam) || param.isBodyParam) && (param.isBinary || param.isFile)) {
+ param.dataType = param.dataType.replace("Uint8List", "MultipartFile");
+ // param.containerType = param.containerType.replace("Uint8List",
+ // "MultipartFile");
+ op.imports.add("MultipartFile");
+
+ if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) {
+ boolean skipFormModel = Boolean
+ .parseBoolean(GlobalSettings.getProperty(CodegenConstants.SKIP_FORM_MODEL, "true"));
+ if (param.isFormParam && param.isContainer && !skipFormModel) {
+ // Because of skipFormModel=false, there is a model class generated which has
+ // "BuiltList" as property and it requires the correct
+ // serializer imports to be added in order to compile.
+ addBuiltValueSerializerImport("Uint8List");
+ }
+ }
+ }
+
+ }
+ // The MultipartFile handling above changes the type of some parameters from
+ // `UInt8List`, the default for files, to `MultipartFile`.
+ //
+ // The following block removes the required import for Uint8List if it is no
+ // longer in use.
+ if (op.allParams.stream().noneMatch(param -> param.dataType.equals("Uint8List"))
+ && op.responses.stream().filter(response -> response.dataType != null)
+ .noneMatch(response -> response.dataType.equals("Uint8List"))) {
+ // Remove unused imports after processing
+ op.imports.remove("Uint8List");
+ }
+
+ resultImports.addAll(rewriteImports(op.imports, false));
+
+ if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) {
+
+ for (CodegenParameter param : op.allParams) {
+ // Generate serializer factories for all container type parameters.
+ // But skip binary and file parameters, JSON serializers don't make sense there.
+ if (param.isContainer && !(param.isBinary || param.isFile)) {
+ addBuiltValueSerializer(BuiltValueSerializer.fromCodegenParameter(param));
+ }
+ }
+ }
+
+ if (op.returnContainer != null && !(op.isResponseBinary || op.isResponseFile)) {
+ addBuiltValueSerializer(BuiltValueSerializer.fromCodegenProperty(op.returnProperty));
+ }
+ }
+ // for some reason "import" structure is changed ..
+ objs.put("imports", resultImports.stream().sorted().collect(Collectors.toList()));
+
+ return objs;
+ }
+
+ private void addBuiltValueSerializerImport(String type) {
+ additionalProperties.compute("builtValueSerializerImports", (k, v) -> {
+ Set imports = v == null ? Sets.newHashSet() : ((Set) v);
+ imports.addAll(rewriteImports(Sets.newHashSet(type), true));
+ return imports;
+ });
+ }
+
+ /**
+ * Adds the serializer to the global list of custom built_value serializers.
+ *
+ * @param serializer
+ */
+ private void addBuiltValueSerializer(BuiltValueSerializer serializer) {
+ additionalProperties.compute("builtValueSerializers", (k, v) -> {
+ Set serializers = v == null ? Sets.newHashSet() : ((Set) v);
+ serializers.add(serializer);
+ return serializers;
+ });
+ }
+
+ private Set rewriteImports(Set originalImports, boolean isModel) {
+ Set resultImports = Sets.newHashSet();
+ for (String modelImport : originalImports) {
+ if (modelImport.startsWith("BuiltList", 0)) {
+ modelImport = "BuiltList";
+ } else if (modelImport.startsWith("BuiltSet", 0)) {
+ modelImport = "BuiltSet";
+ } else if (modelImport.startsWith("BuiltMap", 0)) {
+ modelImport = "BuiltMap";
+ }
+
+ if (imports.containsKey(modelImport)) {
+ String i = imports.get(modelImport);
+ if (Objects.equals(i, DIO_IMPORT) && !isModel) {
+ // Don't add imports to operations that are already imported
+ continue;
+ }
+ resultImports.add(i);
+ } else if (importMapping().containsKey(modelImport)) {
+ resultImports.add(importMapping().get(modelImport));
+ } else if (modelImport.startsWith("dart:")) { // import dart:* directly
+ resultImports.add(modelImport);
+ } else if (modelImport.startsWith("package:")) { // e.g. package:openapi/src/model/child.dart
+ resultImports.add(modelImport);
+ } else {
+ resultImports.add("package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/"
+ + underscore(modelImport) + ".dart");
+ }
+ }
+ return resultImports;
+ }
+
+ static class BuiltValueSerializer {
+ final String containerType;
+ final boolean isContainer;
+ final boolean isArray;
+ final boolean uniqueItems;
+ final boolean isMap;
+ final BuiltValueSerializer items;
+ final boolean isNullable;
+
+ final String datatypeWithEnum;
+ final String dataType;
+
+ public static BuiltValueSerializer fromCodegenParameter(CodegenParameter parameter) {
+ if (parameter == null) {
+ return null;
+ }
+ return new BuiltValueSerializer(parameter.isArray, parameter.getUniqueItems(), parameter.getIsMap(),
+ /// Recursion to handle subtypes
+ fromCodegenProperty(parameter.items),
+ parameter.isNullable, parameter.datatypeWithEnum, parameter.dataType, parameter.containerType,
+ parameter.isContainer);
+ }
+
+ public static BuiltValueSerializer fromCodegenProperty(CodegenProperty property) {
+ if (property == null) {
+ return null;
+ }
+ return new BuiltValueSerializer(property.isArray, property.getUniqueItems(), property.getIsMap(),
+ /// Recursion to handle subtypes
+ fromCodegenProperty(property.items),
+ property.isNullable, property.datatypeWithEnum, property.dataType, property.containerType,
+ property.isContainer);
+ }
+
+ private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, BuiltValueSerializer items,
+ boolean isNullable, String datatypeWithEnum, String dataType, String containerType,
+ boolean isContainer) {
+ this.isArray = isArray;
+ this.uniqueItems = uniqueItems;
+ this.isMap = isMap;
+ this.items = items;
+ this.isNullable = isNullable;
+ this.datatypeWithEnum = datatypeWithEnum;
+ this.dataType = dataType;
+ this.containerType = containerType;
+ this.isContainer = isContainer;
+ }
+
+ public boolean isContainer() {
+ return isContainer;
+ }
+
+ public boolean isArray() {
+ return isArray;
+ }
+
+ public boolean isUniqueItems() {
+ return uniqueItems;
+ }
+
+ public boolean isMap() {
+ return isMap;
+ }
+
+ public BuiltValueSerializer getItems() {
+ return items;
+ }
+
+ public boolean isNullable() {
+ return isNullable;
+ }
+
+ public String getDatatypeWithEnum() {
+ return datatypeWithEnum;
+ }
+
+ public String getContainerType() {
+ return containerType;
+ }
+
+ public String getDataType() {
+ return dataType;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(isContainer, isArray, uniqueItems, isMap, items, isNullable, datatypeWithEnum,
+ dataType);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ BuiltValueSerializer other = (BuiltValueSerializer) obj;
+ if (isContainer != other.isContainer)
+ return false;
+ if (isArray != other.isArray)
+ return false;
+ if (uniqueItems != other.uniqueItems)
+ return false;
+ if (isMap != other.isMap)
+ return false;
+ if (items == null) {
+ if (other.items != null)
+ return false;
+ } else if (!items.equals(other.items))
+ return false;
+ if (isNullable != other.isNullable)
+ return false;
+ if (datatypeWithEnum == null) {
+ if (other.datatypeWithEnum != null)
+ return false;
+ } else if (!datatypeWithEnum.equals(other.datatypeWithEnum))
+ return false;
+ if (dataType == null) {
+ if (other.dataType != null)
+ return false;
+ } else if (!dataType.equals(other.dataType))
+ return false;
+ return true;
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
index ba2d139af981..33a6c3bc5c03 100644
--- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
+++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
@@ -24,6 +24,7 @@ org.openapitools.codegen.languages.CSharpClientCodegen
org.openapitools.codegen.languages.CSharpFunctionsServerCodegen
org.openapitools.codegen.languages.DartClientCodegen
org.openapitools.codegen.languages.DartDioClientCodegen
+org.openapitools.codegen.languages.DartNextClientCodegen
org.openapitools.codegen.languages.EiffelClientCodegen
org.openapitools.codegen.languages.ElixirClientCodegen
org.openapitools.codegen.languages.ElmClientCodegen
diff --git a/modules/openapi-generator/src/main/resources/dart-next/README.mustache b/modules/openapi-generator/src/main/resources/dart-next/README.mustache
new file mode 100644
index 000000000000..50f467f647a3
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/README.mustache
@@ -0,0 +1,126 @@
+# {{pubName}} (EXPERIMENTAL)
+{{#appDescriptionWithNewLines}}
+{{{.}}}
+{{/appDescriptionWithNewLines}}
+
+This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: {{appVersion}}
+{{#artifactVersion}}
+- Package version: {{.}}
+{{/artifactVersion}}
+{{^hideGenerationTimestamp}}
+- Build date: {{generatedDate}}
+{{/hideGenerationTimestamp}}
+- Build package: {{generatorClass}}
+{{#infoUrl}}
+For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
+{{/infoUrl}}
+
+## Requirements
+
+* Dart 2.15.0+ or Flutter 2.8.0+
+* Dio 5.0.0+ (https://pub.dev/packages/dio)
+{{#useJsonSerializable}}
+* JSON Serializable 6.1.5+ (https://pub.dev/packages/json_serializable)
+{{/useJsonSerializable}}
+{{#useDateLibTimeMachine}}
+* timemachine option currently **DOES NOT** support sound null-safety and may not work
+{{/useDateLibTimeMachine}}
+
+## Installation & Usage
+
+### pub.dev
+To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml
+```yaml
+dependencies:
+ {{pubName}}: {{pubVersion}}
+```
+
+### Github
+If this Dart package is published to Github, please include the following in pubspec.yaml
+```yaml
+dependencies:
+ {{pubName}}:
+ git:
+ url: https://github.com/{{gitUserId}}/{{gitRepoId}}.git
+ #ref: main
+```
+
+### Local development
+To use the package from your local drive, please include the following in pubspec.yaml
+```yaml
+dependencies:
+ {{pubName}}:
+ path: /path/to/{{pubName}}
+```
+
+## Getting Started
+
+Please follow the [installation procedure](#installation--usage) and then run the following:
+
+```dart
+import 'package:{{pubName}}/{{pubName}}.dart';
+{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
+
+final api = {{clientName}}().get{{classname}}();
+{{#allParams}}
+final {{{dataType}}} {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
+{{/allParams}}
+
+try {
+ {{#returnType}}final response = await {{/returnType}}api.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
+ {{#returnType}}
+ print(response);
+ {{/returnType}}
+} catch on DioException (e) {
+ print("Exception when calling {{classname}}->{{operationId}}: $e\n");
+}
+{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *{{basePath}}*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[*{{classname}}*]({{modelDocPath}}{{{classname}}}.md) | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}}
+{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
+
+## Documentation For Models
+
+{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
+{{/model}}{{/models}}
+
+## Documentation For Authorization
+
+{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
+{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
+{{#authMethods}}
+### {{{name}}}
+
+{{#isApiKey}}- **Type**: API key
+- **API key parameter name**: {{{keyParamName}}}
+- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
+{{/isApiKey}}
+{{#isBasicBasic}}- **Type**: HTTP basic authentication
+{{/isBasicBasic}}
+{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
+{{/isBasicBearer}}
+{{#isHttpSignature}}- **Type**: HTTP signature authentication
+{{/isHttpSignature}}
+{{#isOAuth}}- **Type**: OAuth
+- **Flow**: {{{flow}}}
+- **Authorization URL**: {{{authorizationUrl}}}
+- **Scopes**: {{^scopes}}N/A{{/scopes}}
+{{#scopes}} - **{{{scope}}}**: {{{description}}}
+{{/scopes}}
+{{/isOAuth}}
+
+{{/authMethods}}
+
+## Author
+
+{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
+{{/-last}}{{/apis}}{{/apiInfo}}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/analysis_options.mustache b/modules/openapi-generator/src/main/resources/dart-next/analysis_options.mustache
new file mode 100644
index 000000000000..ce808d16a9e6
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/analysis_options.mustache
@@ -0,0 +1,12 @@
+analyzer:
+ language:
+ strict-inference: true
+ strict-raw-types: true
+ strict-casts: true
+ exclude: {{#useJsonSerializable}}
+ - lib/{{sourceFolder}}/model/*.g.dart{{/useJsonSerializable}}
+ errors:
+ deprecated_member_use_from_same_package: ignore
+ unused_import: ignore
+ unused_local_variable: ignore
+ unnecessary_import: ignore
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/api.mustache b/modules/openapi-generator/src/main/resources/dart-next/api.mustache
new file mode 100644
index 000000000000..187a30335685
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/api.mustache
@@ -0,0 +1 @@
+{{#includeLibraryTemplate}}api{{/includeLibraryTemplate}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-next/api_doc.mustache
new file mode 100644
index 000000000000..d0b44d0205fd
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/api_doc.mustache
@@ -0,0 +1 @@
+{{#includeLibraryTemplate}}api_doc{{/includeLibraryTemplate}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-next/api_test.mustache
new file mode 100644
index 000000000000..11cce1054484
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/api_test.mustache
@@ -0,0 +1 @@
+{{#includeLibraryTemplate}}api_test{{/includeLibraryTemplate}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/class.mustache b/modules/openapi-generator/src/main/resources/dart-next/class.mustache
new file mode 100644
index 000000000000..5b68e4fdbb30
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/class.mustache
@@ -0,0 +1 @@
+{{#includeSerializationTemplate}}class{{/includeSerializationTemplate}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/enum.mustache b/modules/openapi-generator/src/main/resources/dart-next/enum.mustache
new file mode 100644
index 000000000000..57cb742ded14
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/enum.mustache
@@ -0,0 +1 @@
+{{#includeSerializationTemplate}}enum{{/includeSerializationTemplate}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart-next/gitignore.mustache
new file mode 100644
index 000000000000..4298cdcbd1a2
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/gitignore.mustache
@@ -0,0 +1,41 @@
+# See https://dart.dev/guides/libraries/private-files
+
+# Files and directories created by pub
+.dart_tool/
+.buildlog
+.packages
+.project
+.pub/
+build/
+**/packages/
+
+# Files created by dart2js
+# (Most Dart developers will use pub build to compile Dart, use/modify these
+# rules if you intend to use dart2js directly
+# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
+# differentiate from explicit Javascript files)
+*.dart.js
+*.part.js
+*.js.deps
+*.js.map
+*.info.json
+
+# Directory created by dartdoc
+doc/api/
+
+# Don't commit pubspec lock file
+# (Library packages only! Remove pattern if developing an application package)
+pubspec.lock
+
+# Don’t commit files and directories created by other development environments.
+# For example, if your development environment creates any of the following files,
+# consider putting them in a global ignore file:
+
+# IntelliJ
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# Mac
+.DS_Store
diff --git a/modules/openapi-generator/src/main/resources/dart-next/header.mustache b/modules/openapi-generator/src/main/resources/dart-next/header.mustache
new file mode 100644
index 000000000000..32c88287e5cf
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/header.mustache
@@ -0,0 +1,3 @@
+//
+// AUTO-GENERATED FILE, DO NOT MODIFY!
+//
diff --git a/modules/openapi-generator/src/main/resources/dart-next/lib.mustache b/modules/openapi-generator/src/main/resources/dart-next/lib.mustache
new file mode 100644
index 000000000000..b6cd7489e0ea
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/lib.mustache
@@ -0,0 +1,5 @@
+{{>header}}
+
+export 'apis.dart';
+export 'models.dart';
+export 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart';
diff --git a/modules/openapi-generator/src/main/resources/dart-next/lib_api_exports.mustache b/modules/openapi-generator/src/main/resources/dart-next/lib_api_exports.mustache
new file mode 100644
index 000000000000..81c0ad99e277
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/lib_api_exports.mustache
@@ -0,0 +1,3 @@
+{{#useDio}}export 'package:{{pubName}}/{{sourceFolder}}/api_client.dart';{{/useDio}}{{#apiInfo}}
+{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart';
+{{/apis}}{{/apiInfo}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/lib_model_exports.mustache b/modules/openapi-generator/src/main/resources/dart-next/lib_model_exports.mustache
new file mode 100644
index 000000000000..6e16f8cc6693
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/lib_model_exports.mustache
@@ -0,0 +1,7 @@
+{{#useBuiltValue}}export 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';
+{{#useDateLibCore}}export 'package:{{pubName}}/{{sourceFolder}}/date_serializer.dart';
+export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart';{{/useDateLibCore}}{{/useBuiltValue}}
+export 'package:{{pubName}}/{{sourceFolder}}/repository_base.dart';
+export 'package:{{pubName}}/{{sourceFolder}}/repository_impl.dart';
+{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart';
+{{/model}}{{/models}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache
new file mode 100644
index 000000000000..74d4c9e9fab1
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache
@@ -0,0 +1,37 @@
+{{>header}}
+import 'dart:async';
+import 'package:dio/dio.dart';
+{{#useBuiltValue}}
+import 'package:built_value/built_value.dart';
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/serializer.dart';{{/useBuiltValue}}{{#useJsonSerializable}}
+import 'package:json_annotation/json_annotation.dart';{{/useJsonSerializable}}
+import 'package:{{pubName}}/{{sourceFolder}}/repository_base.dart';
+import 'package:{{pubName}}/{{sourceFolder}}/api_util.dart';
+import 'package:{{pubName}}/models.dart';
+{{#operations}}
+{{#imports}}import '{{.}}';
+{{/imports}}
+
+{{#operation}}
+{{#allParams}}
+{{^isModel}}
+{{#enumName}}
+{{#-first}}
+part '{{classFilename}}.g.dart';
+{{/-first}}
+{{/enumName}}
+{{/isModel}}
+{{/allParams}}
+{{/operation}}
+
+{{>libraries/dio/api_typed}}
+{{>libraries/dio/api_raw}}
+
+{{#operation}}
+{{#allParams}}
+{{>serialization/recursion_enum_inline}}
+{{/allParams}}
+{{/operation}}
+{{/operations}}
+
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_client.mustache
new file mode 100644
index 000000000000..b4a5db7bdc57
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_client.mustache
@@ -0,0 +1,68 @@
+{{>header}}
+import 'package:dio/dio.dart';
+import 'repository_base.dart';
+import 'repository_impl.dart';
+import 'package:{{pubName}}/apis.dart';
+import 'package:{{pubName}}/models.dart';
+import 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart';
+
+class {{clientName}} {
+ static const String basePath = r'{{{basePath}}}';
+
+ final Dio dio;
+ final SerializationRepositoryBase serializationRepository;
+
+
+ {{clientName}}({
+ Dio? dio,
+ SerializationRepositoryBase? serializationRepositoryOverride,
+ String? basePathOverride,
+ List? interceptors,
+ }) : this.dio = dio ??
+ Dio(BaseOptions(
+ baseUrl: basePathOverride ?? basePath,
+ connectTimeout: const Duration(milliseconds: 5000),
+ receiveTimeout: const Duration(milliseconds: 3000),
+ )), this.serializationRepository = serializationRepositoryOverride ?? {{#includeSerializationTemplate}}repository_construction{{/includeSerializationTemplate}} {
+ if (interceptors == null) {
+ this.dio.interceptors.addAll([
+ OAuthInterceptor(),
+ BasicAuthInterceptor(),
+ BearerAuthInterceptor(),
+ ApiKeyAuthInterceptor(),
+ ]);
+ } else {
+ this.dio.interceptors.addAll(interceptors);
+ }
+ }
+
+ void setOAuthToken(String name, String token) {
+ if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) {
+ (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token;
+ }
+ }
+
+ void setBearerAuth(String name, String token) {
+ if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) {
+ (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token;
+ }
+ }
+
+ void setBasicAuth(String name, String username, String password) {
+ if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) {
+ (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password);
+ }
+ }
+
+ void setApiKey(String name, String apiKey) {
+ if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) {
+ (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey;
+ }
+ }{{#apiInfo}}{{#apis}}
+
+ /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful,
+ /// by doing that all interceptors will not be executed
+ {{classname}} get{{classname}}() {
+ return {{classname}}({{classname}}Raw(dio), serializationRepository);
+ }{{/apis}}{{/apiInfo}}
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_doc.mustache
new file mode 100644
index 000000000000..1d852cd31e65
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_doc.mustache
@@ -0,0 +1,86 @@
+# {{pubName}}.api.{{classname}}{{#description}}
+{{.}}{{/description}}
+
+## Load the API package
+```dart
+import 'package:{{pubName}}/{{pubName}}.dart';
+```
+
+All URIs are relative to *{{basePath}}*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}}
+{{/operation}}{{/operations}}
+
+{{#operations}}
+{{#operation}}
+# **{{{operationId}}}**
+> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}})
+
+{{{summary}}}{{#notes}}
+
+{{{.}}}{{/notes}}
+
+### Example
+```dart
+import 'package:{{pubName}}/{{pubName}}.dart';
+{{#hasAuthMethods}}
+{{#authMethods}}
+{{#isBasicBasic}}
+// TODO Configure HTTP basic authorization: {{{name}}}
+//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME'
+//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD';
+{{/isBasicBasic}}
+{{#isApiKey}}
+// TODO Configure API key authorization: {{{name}}}
+//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY';
+// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer';
+{{/isApiKey}}
+{{#isOAuth}}
+// TODO Configure OAuth2 access token for authorization: {{{name}}}
+//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN';
+{{/isOAuth}}
+{{/authMethods}}
+{{/hasAuthMethods}}
+
+final api = {{clientName}}().get{{classname}}();
+{{#allParams}}
+final {{{dataType}}} {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
+{{/allParams}}
+
+try {
+ {{#returnType}}final response = {{/returnType}}api.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
+ {{#returnType}}
+ print(response);
+ {{/returnType}}
+} catch on DioException (e) {
+ print('Exception when calling {{classname}}->{{operationId}}: $e\n');
+}
+```
+
+### Parameters
+{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
+{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
+{{/allParams}}
+
+### Return type
+
+{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
+
+### Authorization
+
+{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
+
+### HTTP request headers
+
+ - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+ - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+{{/operation}}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_raw.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_raw.mustache
new file mode 100644
index 000000000000..dbe677b57bfd
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_raw.mustache
@@ -0,0 +1,94 @@
+class {{classname}}Raw {
+
+ final Dio _dio;
+
+ const {{classname}}Raw(this._dio);
+
+ {{#operation}}
+ /// {{summary}}{{^summary}}{{nickname}}{{/summary}}
+ /// {{notes}}
+ ///
+ /// Parameters:
+ {{#allParams}}
+ /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}}{{#defaultValue}} (Default: {{.}}) {{/defaultValue}}
+ {{/allParams}}
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}}
+ /// Throws [DioException] if API call or serialization fails
+ {{#externalDocs}}
+ /// {{description}}
+ /// Also see [{{summary}} Documentation]({{url}})
+ {{/externalDocs}}
+ {{#isDeprecated}}
+ @Deprecated('This operation has been deprecated')
+ {{/isDeprecated}}
+ Future> {{nickname}}({ {{#allParams}}{{#isPathParam}}
+ {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required String {{paramName}},{{/isPathParam}}{{#isQueryParam}}
+ {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}Object{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isQueryParam}}{{#isHeaderParam}}
+ {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}String{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isHeaderParam}}{{/allParams}}
+ Object? body,
+ String? requestContentType,
+ String? acceptContentType,
+ ResponseType? responseType,
+ CancelToken? cancelToken,
+ Map? headers,
+ Map? extra,
+ ValidateStatus? validateStatus,
+ ProgressCallback? onSendProgress,
+ ProgressCallback? onReceiveProgress,
+ }) async {
+ final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}};
+ final _options = Options(
+ method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}',
+ headers: {
+ {{#httpUserAgent}}
+ r'User-Agent': r'{{{.}}}',
+ {{/httpUserAgent}}
+ {{#headerParams}}
+ {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}},
+ {{/headerParams}}
+ if (acceptContentType != null) 'Accept': acceptContentType,
+ ...?headers,
+ },
+ extra: {
+ 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}}
+ {{#authMethods}}{
+ 'type': '{{type}}',{{#scheme}}
+ 'scheme': '{{.}}',{{/scheme}}
+ 'name': '{{name}}',{{#isApiKey}}
+ 'keyName': '{{keyParamName}}',
+ 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}}
+ },{{/authMethods}}
+ ],{{/hasAuthMethods}}
+ ...?extra,
+ },
+ contentType: requestContentType,
+ responseType: responseType,
+ validateStatus: validateStatus,
+ );{{#hasQueryParams}}
+
+ final _queryParameters = {
+ {{#queryParams}}
+ {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}},
+ {{/queryParams}}
+ };{{/hasQueryParams}}
+
+ return await _dio.request(
+ _path,
+ data: body,
+ options: _options,{{#hasQueryParams}}
+ queryParameters: _queryParameters,{{/hasQueryParams}}
+ cancelToken: cancelToken,
+ onSendProgress: onSendProgress,
+ onReceiveProgress: onReceiveProgress,
+ );
+ }
+
+ {{/operation}}
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_test.mustache
new file mode 100644
index 000000000000..3adeec7072af
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_test.mustache
@@ -0,0 +1,28 @@
+import 'package:test/test.dart';
+import 'package:{{pubName}}/{{pubName}}.dart';
+
+{{#operations}}
+
+/// tests for {{{classname}}}
+void main() {
+ final instance = {{{clientName}}}().get{{{classname}}}();
+
+ group({{{classname}}}, () {
+ {{#operation}}
+ {{#summary}}
+ // {{{.}}}
+ //
+ {{/summary}}
+ {{#notes}}
+ // {{{.}}}
+ //
+ {{/notes}}
+ //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async
+ test('test {{{operationId}}}', () async {
+
+ });
+
+ {{/operation}}
+ });
+}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache
new file mode 100644
index 000000000000..d5419ffac53c
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache
@@ -0,0 +1,112 @@
+class {{classname}} {
+
+ final {{classname}}Raw rawApi;
+ final SerializationRepositoryBase _repository;
+
+ const {{classname}}(this.rawApi, this._repository);
+
+ {{#operation}}
+ /// {{summary}}{{^summary}}{{nickname}}{{/summary}}
+ /// {{notes}}
+ ///
+ /// Parameters:
+ {{#allParams}}
+ /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}}{{#defaultValue}} (Default: {{.}}) {{/defaultValue}}
+ {{/allParams}}
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}}
+ /// Throws [DioException] if API call or serialization fails
+ {{#externalDocs}}
+ /// {{description}}
+ /// Also see [{{summary}} Documentation]({{url}})
+ {{/externalDocs}}
+ {{#isDeprecated}}
+ @Deprecated('This operation has been deprecated')
+ {{/isDeprecated}}
+ Future> {{nickname}}({ {{#allParams}}
+ {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{>types/required}} {{>types/recursion_type}} {{paramName}}{{#defaultValue}} = {{{.}}}{{/defaultValue}},{{/allParams}}
+ CancelToken? cancelToken,
+ Map? headers,
+ Map? extra,
+ ValidateStatus? validateStatus,
+ ProgressCallback? onSendProgress,
+ ProgressCallback? onReceiveProgress,
+ }) async {
+ {{#hasBodyOrFormParams}}
+ Object? _bodyData;
+ {{#hasFormParams}}
+ final _bodyMap = {
+ {{#formParams}}
+ {{^required}}if ({{{paramName}}} != null) {{/required}}r'{{{baseName}}}': await encodeFormParameter(_repository, {{{paramName}}}, {{>types/recursion_type_info}}),
+ {{/formParams}}
+ };
+ {{#isMultipart}}
+ _bodyData = FormData.fromMap(_bodyMap);
+ {{/isMultipart}}
+ {{^isMultipart}}
+ _bodyData = _bodyMap;
+ {{/isMultipart}}
+ {{/hasFormParams}}
+ {{#bodyParam}}
+ _bodyData = await encodeBodyParameter(_repository, {{{paramName}}}, {{>types/recursion_type_info}});
+ {{/bodyParam}}
+ {{/hasBodyOrFormParams}}
+
+ final _response = await rawApi.{{nickname}}(
+ {{#allParams}}{{#isPathParam}}
+ {{paramName}}: await encodeStringParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}),{{/isPathParam}}{{#isQueryParam}}
+ {{paramName}}: await encodeQueryParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}, {{#collectionFormat}}format: ListFormat.{{.}},{{/collectionFormat}}),{{/isQueryParam}}{{#isHeaderParam}}
+ {{paramName}}: await encodeStringParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}), {{/isHeaderParam}}{{/allParams}}
+ {{#hasConsumes}}
+ body: _bodyData,
+ requestContentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}}
+ cancelToken: cancelToken,
+ headers: headers,
+ extra: extra,
+ {{#isResponseFile}}
+ responseType: responseType.bytes,
+ {{/isResponseFile}}
+ validateStatus: validateStatus,
+ onSendProgress: onSendProgress,
+ onReceiveProgress: onReceiveProgress,
+ );
+ {{#returnType}}
+
+ {{{.}}}? _responseData;
+
+ try {
+ final rawResponse = _response.data;
+ {{#returnProperty}}
+ _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, {{>types/recursion_type_info}});
+ {{/returnProperty}}
+ } catch (error, stackTrace) {
+ throw DioException(
+ requestOptions: _response.requestOptions,
+ response: _response,
+ type: DioExceptionType.unknown,
+ error: error,
+ stackTrace: stackTrace,
+ );
+ }
+
+ return Response<{{{.}}}>(
+ data: _responseData,
+ headers: _response.headers,
+ isRedirect: _response.isRedirect,
+ requestOptions: _response.requestOptions,
+ redirects: _response.redirects,
+ statusCode: _response.statusCode,
+ statusMessage: _response.statusMessage,
+ extra: _response.extra,
+ );{{/returnType}}{{^returnType}}
+ return _response;{{/returnType}}
+ }
+
+ {{/operation}}
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache
new file mode 100644
index 000000000000..e6357fd191b6
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache
@@ -0,0 +1,82 @@
+import 'package:dio/dio.dart';
+import 'dart:async';
+import 'dart:convert';
+import 'package:openapi/models.dart';
+import 'dart:typed_data';
+
+/// Format the given form parameter object into something that Dio can handle.
+Future encodeFormParameter(
+ SerializationRepositoryBase repository,
+ T value,
+ TypeInfo type,
+) async {
+ return repository.serialize(
+ value,
+ type,
+ );
+}
+
+Future encodeStringParameter(
+ SerializationRepositoryBase repository,
+ T value,
+ TypeInfo type,
+) async {
+ return (await repository.serialize(value, type)).toString();
+}
+
+Future encodeBodyParameter(
+ SerializationRepositoryBase repository,
+ T value,
+ TypeInfo type,
+) async {
+ return await repository.serialize(
+ value,
+ type,
+ );
+}
+
+Future encodeQueryParameter(
+ SerializationRepositoryBase repository,
+ T value,
+ TypeInfo type, {
+ ListFormat format = ListFormat.multi,
+}) async {
+ if (value == null) {
+ return null;
+ }
+ if (value is String || value is num || value is bool) {
+ return value;
+ }
+ if (value is Uint8List) {
+ // Currently not sure how to serialize this
+ return value;
+ }
+ final serialized = repository.serialize(
+ value,
+ type,
+ );
+ return serialized;
+}
+
+Future> encodeCollectionQueryParameter(
+ SerializationRepositoryBase repository,
+ Iterable value,
+ TypeInfo type, {
+ ListFormat format = ListFormat.multi,
+}) async {
+ final serialized = await repository.serialize(
+ value,
+ type,
+ );
+ if (serialized == null) {
+ return ListParam([], format);
+ }
+ if (serialized is Iterable) {
+ return ListParam(serialized.toList(), format);
+ }
+ throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter');
+}
+
+Future decodeResponse(SerializationRepositoryBase repository, TInput value, TypeInfo type) async {
+ return await repository.deserialize(value, type);
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/api_key_auth.mustache
new file mode 100644
index 000000000000..5d9da99bd5d8
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/api_key_auth.mustache
@@ -0,0 +1,27 @@
+{{>header}}
+
+import 'package:dio/dio.dart';
+import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart';
+
+class ApiKeyAuthInterceptor extends AuthInterceptor {
+ final Map apiKeys = {};
+
+ @override
+ void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
+ final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey');
+ for (final info in authInfo) {
+ final authName = info['name'] as String;
+ final authKeyName = info['keyName'] as String;
+ final authWhere = info['where'] as String;
+ final apiKey = apiKeys[authName];
+ if (apiKey != null) {
+ if (authWhere == 'query') {
+ options.queryParameters[authKeyName] = apiKey;
+ } else {
+ options.headers[authKeyName] = apiKey;
+ }
+ }
+ }
+ super.onRequest(options, handler);
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth.mustache
new file mode 100644
index 000000000000..a266e2384c77
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth.mustache
@@ -0,0 +1,15 @@
+{{>header}}
+import 'package:dio/dio.dart';
+
+abstract class AuthInterceptor extends Interceptor {
+ /// Get auth information on given route for the given type.
+ /// Can return an empty list if type is not present on auth data or
+ /// if route doesn't need authentication.
+ List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) {
+ if (route.extra.containsKey('secure')) {
+ final auth = route.extra['secure'] as List>;
+ return auth.where((secure) => handles(secure)).toList();
+ }
+ return [];
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth_exports.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth_exports.mustache
new file mode 100644
index 000000000000..f038e92358ef
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth_exports.mustache
@@ -0,0 +1,5 @@
+export 'api_key_auth.dart';
+export 'basic_auth.dart';
+export 'oauth.dart';
+export 'bearer_auth.dart';
+export 'auth.dart';
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/basic_auth.mustache
new file mode 100644
index 000000000000..c2a4426937da
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/basic_auth.mustache
@@ -0,0 +1,34 @@
+{{>header}}
+import 'dart:convert';
+
+import 'package:dio/dio.dart';
+import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart';
+
+class BasicAuthInfo {
+ final String username;
+ final String password;
+
+ const BasicAuthInfo(this.username, this.password);
+}
+
+class BasicAuthInterceptor extends AuthInterceptor {
+ final Map authInfo = {};
+
+ @override
+ void onRequest(
+ RequestOptions options,
+ RequestInterceptorHandler handler,
+ ) {
+ final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic');
+ for (final info in metadataAuthInfo) {
+ final authName = info['name'] as String;
+ final basicAuthInfo = authInfo[authName];
+ if (basicAuthInfo != null) {
+ final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}';
+ options.headers['Authorization'] = basicAuth;
+ break;
+ }
+ }
+ super.onRequest(options, handler);
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/bearer_auth.mustache
new file mode 100644
index 000000000000..b4bce45ca61f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/bearer_auth.mustache
@@ -0,0 +1,23 @@
+{{>header}}
+import 'package:dio/dio.dart';
+import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart';
+
+class BearerAuthInterceptor extends AuthInterceptor {
+ final Map tokens = {};
+
+ @override
+ void onRequest(
+ RequestOptions options,
+ RequestInterceptorHandler handler,
+ ) {
+ final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer');
+ for (final info in authInfo) {
+ final token = tokens[info['name']];
+ if (token != null) {
+ options.headers['Authorization'] = 'Bearer ${token}';
+ break;
+ }
+ }
+ super.onRequest(options, handler);
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/oauth.mustache
new file mode 100644
index 000000000000..e5af801f39be
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/oauth.mustache
@@ -0,0 +1,23 @@
+{{>header}}
+import 'package:dio/dio.dart';
+import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart';
+
+class OAuthInterceptor extends AuthInterceptor {
+ final Map tokens = {};
+
+ @override
+ void onRequest(
+ RequestOptions options,
+ RequestInterceptorHandler handler,
+ ) {
+ final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2');
+ for (final info in authInfo) {
+ final token = tokens[info['name']];
+ if (token != null) {
+ options.headers['Authorization'] = 'Bearer ${token}';
+ break;
+ }
+ }
+ super.onRequest(options, handler);
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/model.mustache b/modules/openapi-generator/src/main/resources/dart-next/model.mustache
new file mode 100644
index 000000000000..1917decaf6c6
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/model.mustache
@@ -0,0 +1,10 @@
+{{>header}}
+// ignore_for_file: unused_element
+{{#models}}
+ {{#model}}
+ {{#imports}}
+import '{{.}}';
+ {{/imports}}
+{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}}
+ {{/model}}
+{{/models}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/model_test.mustache b/modules/openapi-generator/src/main/resources/dart-next/model_test.mustache
new file mode 100644
index 000000000000..e11b878ff632
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/model_test.mustache
@@ -0,0 +1,27 @@
+{{#models}}
+{{#model}}
+import 'package:test/test.dart';
+import 'package:{{pubName}}/{{pubName}}.dart';
+
+// tests for {{{classname}}}
+void main() {
+ {{^isEnum}}
+ {{! Due to required vars without default value we can not create a full instance here }}
+{{#includeSerializationTemplate}}test_instance{{/includeSerializationTemplate}}
+ {{/isEnum}}
+
+ group({{{classname}}}, () {
+ {{#vars}}
+ {{#description}}
+ // {{{.}}}
+ {{/description}}
+ // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}}
+ test('to test the property `{{{name}}}`', () async {
+
+ });
+
+ {{/vars}}
+ });
+}
+{{/model}}
+{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart-next/object_doc.mustache
new file mode 100644
index 000000000000..6dae3f1d7779
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/object_doc.mustache
@@ -0,0 +1,16 @@
+{{#models}}{{#model}}# {{pubName}}.model.{{classname}}
+
+## Load the model package
+```dart
+import 'package:{{pubName}}/{{pubName}}.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
+{{/vars}}
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart-next/pubspec.mustache
new file mode 100644
index 000000000000..8e1e1d153dae
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/pubspec.mustache
@@ -0,0 +1,39 @@
+name: {{pubName}}
+version: {{pubVersion}}
+description: {{pubDescription}}
+homepage: {{pubHomepage}}
+{{#pubRepository}}
+repository: {{.}}
+{{/pubRepository}}
+{{#pubPublishTo}}
+publish_to: {{.}}
+{{/pubPublishTo}}
+
+environment:
+ sdk: '>=2.15.0 <3.0.0'
+
+dependencies:
+ dio: '^5.2.0'
+{{#useBuiltValue}}
+ one_of: '>=1.5.0 <2.0.0'
+ one_of_serializer: '>=1.5.0 <2.0.0'
+ built_value: '>=8.4.0 <9.0.0'
+ built_collection: '>=5.1.1 <6.0.0'
+{{/useBuiltValue}}
+{{#useJsonSerializable}}
+ json_annotation: ^4.8.1
+{{/useJsonSerializable}}
+{{#useDateLibTimeMachine}}
+ time_machine: ^0.9.16
+{{/useDateLibTimeMachine}}
+
+dev_dependencies:
+{{#useBuiltValue}}
+ built_value_generator: '>=8.4.0 <9.0.0'
+ build_runner: any
+{{/useBuiltValue}}
+{{#useJsonSerializable}}
+ build_runner: any
+ json_serializable: '^6.1.5'
+{{/useJsonSerializable}}
+ test: ^1.16.0
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class.mustache
new file mode 100644
index 000000000000..b917ad0c085d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class.mustache
@@ -0,0 +1,28 @@
+import 'package:built_value/built_value.dart';
+import 'package:built_value/serializer.dart';{{#oneOf}}{{#-first}}
+import 'package:one_of/one_of.dart';{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}
+import 'package:one_of/any_of.dart';{{/-first}}{{/anyOf}}
+
+{{#imports}}
+{{/imports}}
+part '{{classFilename}}.g.dart';
+
+{{>serialization/built_value/class_header}} {
+{{>serialization/built_value/class_members}}
+}
+{{#discriminator}}{{#hasDiscriminatorWithNonEmptyMapping}}
+{{>serialization/built_value/class_discriminator}}
+{{/hasDiscriminatorWithNonEmptyMapping}}{{/discriminator}}
+{{>serialization/built_value/class_serializer}}{{#vendorExtensions.x-is-parent}}
+
+{{>serialization/built_value/class_concrete}}{{/vendorExtensions.x-is-parent}}
+{{!
+ Generate an enum for any variables that are declared as inline enums
+ isEnum is only true for inline variables that are enums.
+ If an enum is declared as a definition, isEnum is false and the enum is generated from the
+ enum.mustache template.
+ enumName only exists for inline enums
+}}
+{{#vars}}
+{{>serialization/built_value/recursion_enum_inline}}
+{{/vars}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_concrete.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_concrete.mustache
new file mode 100644
index 000000000000..44cad763010a
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_concrete.mustache
@@ -0,0 +1,56 @@
+/// a concrete implementation of [{{classname}}], since [{{classname}}] is not instantiable
+@BuiltValue(instantiable: true)
+abstract class ${{classname}} implements {{classname}}, Built<${{classname}}, ${{classname}}Builder> {
+ ${{classname}}._();
+
+ factory ${{classname}}([void Function(${{classname}}Builder)? updates]) = _$${{classname}};
+
+ @BuiltValueHook(initializeBuilder: true)
+ static void _defaults(${{classname}}Builder b) => b;
+
+ @BuiltValueSerializer(custom: true)
+ static Serializer<${{classname}}> get serializer => _$${{classname}}Serializer();
+}
+
+class _$${{classname}}Serializer implements PrimitiveSerializer<${{classname}}> {
+ @override
+ final Iterable types = const [${{classname}}, _$${{classname}}];
+
+ @override
+ final String wireName = r'${{classname}}';
+
+ @override
+ Object serialize(
+ Serializers serializers,
+ ${{{classname}}} object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
+ return serializers.serialize(object, specifiedType: FullType({{classname}}))!;
+ }
+
+{{#vendorExtensions.x-has-self-and-ancestor-only-props}}{{>serialization/built_value/deserialize_properties}}
+
+{{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ @override
+ ${{classname}} deserialize(
+ Serializers serializers,
+ Object serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
+ final result = ${{classname}}Builder();
+ {{#vendorExtensions.x-has-self-and-ancestor-only-props}}
+ final serializedList = (serialized as Iterable).toList();
+ final unhandled = [];
+ _deserializeProperties(
+ serializers,
+ serialized,
+ specifiedType: specifiedType,
+ serializedList: serializedList,
+ unhandled: unhandled,
+ result: result,
+ );
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{! when discriminator is involved, read it, then return based on value }}
+ return result.build();
+ }
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_discriminator.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_discriminator.mustache
new file mode 100644
index 000000000000..f867345883b1
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_discriminator.mustache
@@ -0,0 +1,20 @@
+extension {{classname}}DiscriminatorExt on {{classname}} {
+ String? get discriminatorValue {
+ {{#mappedModels}}
+ if (this is {{modelName}}) {
+ return r'{{mappingName}}';
+ }
+ {{/mappedModels}}
+ return null;
+ }
+}
+extension {{classname}}BuilderDiscriminatorExt on {{classname}}Builder {
+ String? get discriminatorValue {
+ {{#mappedModels}}
+ if (this is {{modelName}}Builder) {
+ return r'{{mappingName}}';
+ }
+ {{/mappedModels}}
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_header.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_header.mustache
new file mode 100644
index 000000000000..a059dc504798
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_header.mustache
@@ -0,0 +1,13 @@
+/// {{{description}}}{{^description}}{{classname}}{{/description}}
+{{#hasVars}}
+///
+/// Properties:
+{{#allVars}}
+/// * [{{{name}}}] {{#description}}- {{{.}}}{{/description}}
+{{/allVars}}
+{{/hasVars}}
+{{#isDeprecated}}
+@Deprecated('{{{classname}}} has been deprecated')
+{{/isDeprecated}}
+@BuiltValue({{#vendorExtensions.x-is-parent}}instantiable: false{{/vendorExtensions.x-is-parent}})
+abstract class {{classname}} {{^allOf}}{{^vendorExtensions.x-is-parent}}implements {{/vendorExtensions.x-is-parent}}{{/allOf}}{{#allOf}}{{#-first}}implements {{/-first}}{{/allOf}}{{#allOf}}{{{.}}}{{^-last}}, {{/-last}}{{/allOf}}{{^vendorExtensions.x-is-parent}}{{#allOf}}{{#-first}}, {{/-first}}{{/allOf}}{{/vendorExtensions.x-is-parent}}{{^vendorExtensions.x-is-parent}}Built<{{classname}}, {{classname}}Builder>{{/vendorExtensions.x-is-parent}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_members.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_members.mustache
new file mode 100644
index 000000000000..47a355ed5e1e
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_members.mustache
@@ -0,0 +1,38 @@
+{{! define variables that aren't inherited from allOf/anyOf/oneOf }}
+{{#vendorExtensions.x-self-only-props}}
+ {{#description}}
+ /// {{{.}}}
+ {{/description}}
+ {{#deprecated}}
+ @Deprecated('{{{name}}} has been deprecated')
+ {{/deprecated}}
+ @BuiltValueField(wireName: r'{{baseName}}')
+ {{>types/recursion_type}}{{^isNullable}}{{^required}}?{{/required}}{{/isNullable}} get {{name}};
+ {{#allowableValues}}
+ // {{#min}}range from {{{min}}} to {{{max}}}{{/min}}{{^min}}enum {{name}}Enum { {{#values}} {{{.}}}, {{/values}} };{{/min}}
+ {{/allowableValues}}
+
+{{/vendorExtensions.x-self-only-props}}{{#anyOf}}{{#-first}} /// Any Of {{#anyOf}}[{{{.}}}]{{^-last}}, {{/-last}}{{/anyOf}}
+ AnyOf get anyOf;
+
+{{/-first}}{{/anyOf}}{{#oneOf}}{{#-first}} /// One Of {{#oneOf}}[{{{.}}}]{{^-last}}, {{/-last}}{{/oneOf}}
+ OneOf get oneOf;
+
+{{/-first}}{{/oneOf}}{{#discriminator}} static const String discriminatorFieldName = r'{{propertyBaseName}}';{{#hasDiscriminatorWithNonEmptyMapping}}
+
+ static const Map discriminatorMapping = {
+ {{#mappedModels}}
+ r'{{mappingName}}': {{modelName}},
+ {{/mappedModels}}
+ };{{/hasDiscriminatorWithNonEmptyMapping}}
+
+{{/discriminator}}{{^vendorExtensions.x-is-parent}} {{classname}}._();
+
+ factory {{classname}}([void updates({{classname}}Builder b)]) = _${{classname}};
+
+ @BuiltValueHook(initializeBuilder: true)
+ static void _defaults({{{classname}}}Builder b) => b{{#vendorExtensions.x-parent-discriminator}}..{{propertyName}}=b.discriminatorValue{{/vendorExtensions.x-parent-discriminator}}{{#vendorExtensions.x-self-and-ancestor-only-props}}{{#defaultValue}}
+ ..{{{name}}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/vendorExtensions.x-self-and-ancestor-only-props}};
+
+{{/vendorExtensions.x-is-parent}} @BuiltValueSerializer(custom: true)
+ static Serializer<{{classname}}> get serializer => _${{classname}}Serializer();
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_serializer.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_serializer.mustache
new file mode 100644
index 000000000000..4cd02f3506de
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_serializer.mustache
@@ -0,0 +1,307 @@
+class _${{classname}}Serializer implements PrimitiveSerializer<{{classname}}> {
+ @override
+ final Iterable types = const [{{classname}}{{^vendorExtensions.x-is-parent}}, _${{classname}}{{/vendorExtensions.x-is-parent}}];
+
+ @override
+ final String wireName = r'{{classname}}';
+
+ Iterable _serializeProperties(
+ Serializers serializers,
+ {{{classname}}} object, {
+ FullType specifiedType = FullType.unspecified,
+ }) sync* {
+ {{#vendorExtensions.x-self-and-ancestor-only-props}}
+ {{#required}}
+ {{!
+ A required property need to always be part of the serialized output.
+ When it is nullable, null is serialized, otherwise it is an error if it is null.
+ }}
+ yield r'{{baseName}}';
+ yield {{#isNullable}}object.{{{name}}} == null ? null : {{/isNullable}}serializers.serialize(
+ object.{{{name}}},
+ specifiedType: const {{>serialization/built_value/variable_serializer_type}},
+ );
+ {{/required}}
+ {{^required}}
+ if (object.{{{name}}} != null) {
+ {{! Non-required properties are only serialized if not null. }}
+ yield r'{{baseName}}';
+ yield serializers.serialize(
+ object.{{{name}}},
+ specifiedType: const {{>serialization/built_value/variable_serializer_type}},
+ );
+ }
+ {{/required}}
+ {{/vendorExtensions.x-self-and-ancestor-only-props}}
+ }
+
+ @override
+ Object serialize(
+ Serializers serializers,
+ {{{classname}}} object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
+ {{! oneOf }}
+ {{#oneOf}}
+ {{#-first}}
+ final oneOf = object.oneOf;
+ {{#vendorExtensions.x-self-and-ancestor-only-props}}
+ final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
+ result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable);
+ return result;
+ {{/vendorExtensions.x-self-and-ancestor-only-props}}
+ {{^vendorExtensions.x-self-and-ancestor-only-props}}
+ return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!;
+ {{/vendorExtensions.x-self-and-ancestor-only-props}}
+ {{/-first}}
+ {{/oneOf}}
+ {{! anyOf }}
+ {{#anyOf}}
+ {{#-first}}
+ final anyOf = object.anyOf;
+ {{#vendorExtensions.x-self-and-ancestor-only-props}}
+ final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
+ final serialized = serializers.serialize(anyOf, specifiedType: FullType(AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList()));
+ result.addAll((serialized is Map ? serialized.entries.map((e) => [e.key, e.value]).expand((e) => e) : serialized) as Iterable);
+ return result;
+ {{/vendorExtensions.x-self-and-ancestor-only-props}}
+ {{^vendorExtensions.x-self-and-ancestor-only-props}}
+ return serializers.serialize(anyOf, specifiedType: FullType(AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList()))!;
+ {{/vendorExtensions.x-self-and-ancestor-only-props}}
+ {{/-first}}
+ {{/anyOf}}
+ {{^oneOf}}
+ {{^anyOf}}
+ {{#hasDiscriminatorWithNonEmptyMapping}}
+ {{#discriminator}}
+ {{! handle discriminator }}
+ {{#mappedModels}}
+ if (object is {{modelName}}) {
+ return serializers.serialize(object, specifiedType: FullType({{modelName}}))!;
+ }
+ {{/mappedModels}}
+ {{/discriminator}}
+ {{/hasDiscriminatorWithNonEmptyMapping}}
+ return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
+ {{/anyOf}}
+ {{/oneOf}}
+ }
+
+{{#vendorExtensions.x-has-self-and-ancestor-only-props}}{{^vendorExtensions.x-is-parent}}{{>serialization/built_value/deserialize_properties}}
+
+{{/vendorExtensions.x-is-parent}}{{/vendorExtensions.x-has-self-and-ancestor-only-props}} @override
+ {{classname}} deserialize(
+ Serializers serializers,
+ Object serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
+ {{! oneOf }}
+ {{#oneOf}}
+ {{#-first}}
+ final result = {{#vendorExtensions.x-is-parent}}${{/vendorExtensions.x-is-parent}}{{classname}}Builder();
+ Object? oneOfDataSrc;
+ {{#hasDiscriminatorWithNonEmptyMapping}}
+ {{#discriminator}}
+ {{! has props, assign them to result, and extract unhandled }}
+ final serializedList = (serialized as Iterable).toList();
+ final discIndex = serializedList.indexOf({{classname}}.discriminatorFieldName) + 1;
+ final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String;
+ {{#vendorExtensions.x-has-self-and-ancestor-only-props}}
+ final unhandled = [];
+ _deserializeProperties(
+ serializers,
+ serialized,
+ specifiedType: specifiedType,
+ serializedList: serializedList,
+ unhandled: unhandled,
+ result: result
+ );
+ {{! only deserialize unhandled props }}
+ oneOfDataSrc = unhandled;
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{^vendorExtensions.x-has-self-and-ancestor-only-props}}
+ oneOfDataSrc = serialized;
+ {{! has no probs at all, pass the serialized as is }}
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ final oneOfTypes = [{{#mappedModels}}{{modelName}}, {{/mappedModels}}{{#vendorExtensions.x-is-parent}}${{classname}}{{/vendorExtensions.x-is-parent}}];
+ Object oneOfResult;
+ Type oneOfType;
+ switch (discValue) {
+ {{#mappedModels}}
+ case r'{{mappingName}}':
+ oneOfResult = serializers.deserialize(
+ oneOfDataSrc,
+ specifiedType: FullType({{modelName}}),
+ ) as {{modelName}};
+ oneOfType = {{modelName}};
+ break;
+ {{/mappedModels}}
+ default:
+ {{#vendorExtensions.x-is-parent}}
+ oneOfResult = serializers.deserialize(
+ oneOfDataSrc,
+ specifiedType: FullType(${{classname}}),
+ ) as ${{classname}};
+ oneOfType = ${{classname}};
+ {{/vendorExtensions.x-is-parent}}
+ {{^vendorExtensions.x-is-parent}}
+ throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}");
+ {{/vendorExtensions.x-is-parent}}
+ }
+ result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult);
+ {{/discriminator}}
+ {{/hasDiscriminatorWithNonEmptyMapping}}
+ {{^hasDiscriminatorWithNonEmptyMapping}}
+ {{! use the OneOfSerializer when there is no discriminator }}
+ final targetType = const FullType(OneOf, [{{#composedSchemas}}{{#oneOf}}{{>serialization/built_value/variable_serializer_type}}, {{/oneOf}}{{/composedSchemas}}]);
+ {{#vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{! has props, assign them to result, and extract unhandled }}
+ final serializedList = (serialized as Iterable).toList();
+ final unhandled = [];
+ _deserializeProperties(
+ serializers,
+ serialized,
+ specifiedType: specifiedType,
+ serializedList: serializedList,
+ unhandled: unhandled,
+ result: result,
+ );
+ {{! only deserialize unhandled props }}
+ oneOfDataSrc = unhandled;
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{^vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{! has no probs at all, pass the serialized as is }}
+ oneOfDataSrc = serialized;
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf;
+ {{/hasDiscriminatorWithNonEmptyMapping}}
+ return result.build();
+ {{/-first}}
+ {{/oneOf}}
+ {{! anyOf }}
+ {{#anyOf}}
+ {{#-first}}
+ final result = {{#vendorExtensions.x-is-parent}}${{/vendorExtensions.x-is-parent}}{{classname}}Builder();
+ Object? anyOfDataSrc;
+ {{#hasDiscriminatorWithNonEmptyMapping}}
+ {{#discriminator}}
+ {{! has props, assign them to result, and extract unhandled }}
+ final serializedList = (serialized as Iterable).toList();
+ final discIndex = serializedList.indexOf({{classname}}.discriminatorFieldName) + 1;
+ final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String;
+ {{#vendorExtensions.x-has-self-and-ancestor-only-props}}
+ final unhandled = [];
+ _deserializeProperties(
+ serializers,
+ serialized,
+ specifiedType: specifiedType,
+ serializedList: serializedList,
+ unhandled: unhandled,
+ result: result,
+ );
+ {{! only deserialize unhandled props }}
+ anyOfDataSrc = unhandled;
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{^vendorExtensions.x-has-self-and-ancestor-only-props}}
+ anyOfDataSrc = serialized;
+ {{! has no probs at all, pass the serialized as is }}
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ final anyOfTypes = [{{#mappedModels}}{{modelName}}, {{/mappedModels}}{{#vendorExtensions.x-is-parent}}${{classname}}{{/vendorExtensions.x-is-parent}}];
+ Object anyOfResult;
+ Type anyOfType;
+ switch (discValue) {
+ {{#mappedModels}}
+ case r'{{mappingName}}':
+ anyOfResult = serializers.deserialize(anyOfDataSrc, specifiedType: FullType({{modelName}})) as {{modelName}};
+ anyOfType = {{modelName}};
+ break;
+ {{/mappedModels}}
+ default:
+ {{#vendorExtensions.x-is-parent}}
+ anyOfResult = serializers.deserialize(anyOfDataSrc, specifiedType: FullType(${{classname}})) as ${{classname}};
+ anyOfType = ${{classname}};
+ {{/vendorExtensions.x-is-parent}}
+ {{^vendorExtensions.x-is-parent}}
+ throw UnsupportedError("Couldn't deserialize anyOf for the discriminator value: ${discValue}");
+ {{/vendorExtensions.x-is-parent}}
+ }
+ result.anyOf = AnyOfDynamic(values: {anyOfTypes.indexOf(anyOfType): anyOfResult}, types: anyOfTypes);
+ {{/discriminator}}
+ {{/hasDiscriminatorWithNonEmptyMapping}}
+ {{^hasDiscriminatorWithNonEmptyMapping}}
+ {{! use the OneOfSerializer when there is no discriminator }}
+ final targetType = const FullType(AnyOf, [{{#composedSchemas}}{{#anyOf}}{{>serialization/built_value/variable_serializer_type}}, {{/anyOf}}{{/composedSchemas}}]);
+ {{#vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{! has props, assign them to result, and extract unhandled }}
+ final serializedList = (serialized as Iterable).toList();
+ final unhandled = [];
+ _deserializeProperties(
+ serializers,
+ serialized,
+ specifiedType: specifiedType,
+ serializedList: serializedList,
+ unhandled: unhandled,
+ result: result,
+ );
+ {{! only deserialize unhandled props }}
+ anyOfDataSrc = unhandled;
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{^vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{! has no probs at all, pass the serialized as is }}
+ anyOfDataSrc = serialized;
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ result.anyOf = serializers.deserialize(anyOfDataSrc, specifiedType: targetType) as AnyOf;
+ {{/hasDiscriminatorWithNonEmptyMapping}}
+ return result.build();
+ {{/-first}}
+ {{/anyOf}}
+ {{! no anyOf nor oneOf, handles allOf trees }}
+ {{^oneOf}}
+ {{^anyOf}}
+ {{#vendorExtensions.x-is-parent}}
+ {{!
+ parent classes don't have builder
+ so they must delegate to another serializer using
+ 1) discriminator + mapping
+ 2) concrete implementation ($classname)
+ }}
+ {{#hasDiscriminatorWithNonEmptyMapping}}
+ {{#discriminator}}
+ final serializedList = (serialized as Iterable).toList();
+ final discIndex = serializedList.indexOf({{classname}}.discriminatorFieldName) + 1;
+ final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String;
+ switch (discValue) {
+ {{#mappedModels}}
+ case r'{{mappingName}}':
+ return serializers.deserialize(serialized, specifiedType: FullType({{modelName}})) as {{modelName}};
+ {{/mappedModels}}
+ default:
+ return serializers.deserialize(serialized, specifiedType: FullType(${{classname}})) as ${{classname}};
+ }
+ {{/discriminator}}
+ {{/hasDiscriminatorWithNonEmptyMapping}}
+ {{^hasDiscriminatorWithNonEmptyMapping}}
+ return serializers.deserialize(serialized, specifiedType: FullType(${{classname}})) as ${{classname}};
+ {{/hasDiscriminatorWithNonEmptyMapping}}
+ {{/vendorExtensions.x-is-parent}}
+ {{^vendorExtensions.x-is-parent}}
+ final result = {{classname}}Builder();
+ final serializedList = (serialized as Iterable).toList();
+ {{#vendorExtensions.x-has-self-and-ancestor-only-props}}
+ {{! has props, assign them to result, and extract unhandled }}
+ final unhandled = [];
+ _deserializeProperties(
+ serializers,
+ serialized,
+ specifiedType: specifiedType,
+ serializedList: serializedList,
+ unhandled: unhandled,
+ result: result,
+ );
+ {{/vendorExtensions.x-has-self-and-ancestor-only-props}}
+ return result.build();
+ {{/vendorExtensions.x-is-parent}}
+ {{/anyOf}}
+ {{/oneOf}}
+ }
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date.mustache
new file mode 100644
index 000000000000..b21c7f544bee
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date.mustache
@@ -0,0 +1,70 @@
+/// A gregorian calendar date generated by
+/// OpenAPI generator to differentiate
+/// between [DateTime] and [Date] formats.
+class Date implements Comparable {
+ final int year;
+
+ /// January is 1.
+ final int month;
+
+ /// First day is 1.
+ final int day;
+
+ Date(this.year, this.month, this.day);
+
+ /// The current date
+ static Date now({bool utc = false}) {
+ var now = DateTime.now();
+ if (utc) {
+ now = now.toUtc();
+ }
+ return now.toDate();
+ }
+
+ /// Convert to a [DateTime].
+ DateTime toDateTime({bool utc = false}) {
+ if (utc) {
+ return DateTime.utc(year, month, day);
+ } else {
+ return DateTime(year, month, day);
+ }
+ }
+
+ @override
+ int compareTo(Date other) {
+ int d = year.compareTo(other.year);
+ if (d != 0) {
+ return d;
+ }
+ d = month.compareTo(other.month);
+ if (d != 0) {
+ return d;
+ }
+ return day.compareTo(other.day);
+ }
+
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ other is Date &&
+ runtimeType == other.runtimeType &&
+ year == other.year &&
+ month == other.month &&
+ day == other.day;
+
+ @override
+ int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode;
+
+ @override
+ String toString() {
+ final yyyy = year.toString();
+ final mm = month.toString().padLeft(2, '0');
+ final dd = day.toString().padLeft(2, '0');
+
+ return '$yyyy-$mm-$dd';
+ }
+}
+
+extension DateTimeToDate on DateTime {
+ Date toDate() => Date(year, month, day);
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date_serializer.mustache
new file mode 100644
index 000000000000..3391e775c7f7
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date_serializer.mustache
@@ -0,0 +1,28 @@
+{{>header}}
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/serializer.dart';
+import '{{modelPackage}}/date.dart';
+
+class DateSerializer implements PrimitiveSerializer {
+
+ const DateSerializer();
+
+ @override
+ Iterable get types => BuiltList.of([Date]);
+
+ @override
+ String get wireName => 'Date';
+
+ @override
+ Date deserialize(Serializers serializers, Object serialized,
+ {FullType specifiedType = FullType.unspecified}) {
+ final parsed = DateTime.parse(serialized as String);
+ return Date(parsed.year, parsed.month, parsed.day);
+ }
+
+ @override
+ Object serialize(Serializers serializers, Date date,
+ {FullType specifiedType = FullType.unspecified}) {
+ return date.toString();
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/deserialize_properties.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/deserialize_properties.mustache
new file mode 100644
index 000000000000..d8dbfdfd4d8d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/deserialize_properties.mustache
@@ -0,0 +1,57 @@
+ void _deserializeProperties(
+ Serializers serializers,
+ Object serialized, {
+ FullType specifiedType = FullType.unspecified,
+ required List serializedList,
+ required {{classname}}Builder result,
+ required List unhandled,
+ }) {
+ for (var i = 0; i < serializedList.length; i += 2) {
+ final key = serializedList[i] as String;
+ final value = serializedList[i + 1];
+ switch (key) {
+ {{#vendorExtensions.x-self-and-ancestor-only-props}}
+ case r'{{baseName}}':
+ final valueDes = serializers.deserialize(
+ value,
+ specifiedType: const {{>serialization/built_value/variable_serializer_type}},
+ ) as {{>types/recursion_type}};
+ {{#isNullable}}
+ if (valueDes == null) continue;
+ {{/isNullable}}
+ {{#isContainer}}
+ result.{{{name}}}.replace(valueDes);
+ {{/isContainer}}
+ {{^isContainer}}
+ {{#isEnum}}
+ result.{{{name}}} = valueDes;
+ {{/isEnum}}
+ {{^isEnum}}
+ {{#isModel}}
+ {{#isPrimitiveType}}
+ {{! These are models that have been manually marked as primitive via generator param. }}
+ result.{{{name}}} = valueDes;
+ {{/isPrimitiveType}}
+ {{^isPrimitiveType}}
+ {{#vendorExtensions.x-is-parent}}
+ result.{{{name}}} = valueDes;
+ {{/vendorExtensions.x-is-parent}}
+ {{^vendorExtensions.x-is-parent}}
+ result.{{{name}}}.replace(valueDes);
+ {{/vendorExtensions.x-is-parent}}
+ {{/isPrimitiveType}}
+ {{/isModel}}
+ {{^isModel}}
+ result.{{{name}}} = valueDes;
+ {{/isModel}}
+ {{/isEnum}}
+ {{/isContainer}}
+ break;
+ {{/vendorExtensions.x-self-and-ancestor-only-props}}
+ default:
+ unhandled.add(key);
+ unhandled.add(value);
+ break;
+ }
+ }
+ }
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum.mustache
new file mode 100644
index 000000000000..83033f367aab
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum.mustache
@@ -0,0 +1,36 @@
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/built_value.dart';
+import 'package:built_value/serializer.dart';
+
+part '{{classFilename}}.g.dart';
+
+{{#isDeprecated}}
+@Deprecated('{{{classname}}} has been deprecated')
+{{/isDeprecated}}
+class {{classname}} extends EnumClass {
+
+ {{#allowableValues}}
+ {{#enumVars}}
+ {{#description}}
+ /// {{{.}}}
+ {{/description}}
+ @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: {{{value}}}{{/isLong}}{{/isInteger}}{{#enumUnknownDefaultCase}}{{#-last}}, fallback: true{{/-last}}{{/enumUnknownDefaultCase}})
+ static const {{classname}} {{name}} = _${{name}};
+ {{/enumVars}}
+ {{/allowableValues}}
+
+ static Serializer<{{classname}}> get serializer => _${{#lambda.camelcase}}{{{classname}}}{{/lambda.camelcase}}Serializer;
+
+ const {{classname}}._(String name): super(name);
+
+ static BuiltSet<{{classname}}> get values => _$values;
+ static {{classname}} valueOf(String name) => _$valueOf(name);
+}
+
+/// Optionally, enum_class can generate a mixin to go with your enum for use
+/// with Angular. It exposes your enum constants as getters. So, if you mix it
+/// in to your Dart component class, the values become available to the
+/// corresponding Angular template.
+///
+/// Trigger mixin generation by writing a line like this one next to your enum.
+typedef {{classname}}Mixin = _${{classname}}Mixin;
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum_inline.mustache
new file mode 100644
index 000000000000..d1fd32192c83
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum_inline.mustache
@@ -0,0 +1,22 @@
+{{#isDeprecated}}
+@Deprecated('{{{enumName}}} has been deprecated')
+{{/isDeprecated}}
+class {{{enumName}}} extends EnumClass {
+
+ {{#allowableValues}}
+ {{#enumVars}}
+ {{#description}}
+ /// {{{.}}}
+ {{/description}}
+ @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: {{{value}}}{{/isLong}}{{/isInteger}}{{#enumUnknownDefaultCase}}{{#-last}}, fallback: true{{/-last}}{{/enumUnknownDefaultCase}})
+ static const {{{enumName}}} {{name}} = _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}_{{name}};
+ {{/enumVars}}
+ {{/allowableValues}}
+
+ static Serializer<{{{enumName}}}> get serializer => _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}Serializer;
+
+ const {{{enumName}}}._(String name): super(name);
+
+ static BuiltSet<{{{enumName}}}> get values => _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}Values;
+ static {{{enumName}}} valueOf(String name) => _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}ValueOf(name);
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/offset_date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/offset_date_serializer.mustache
new file mode 100644
index 000000000000..2698caf0f493
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/offset_date_serializer.mustache
@@ -0,0 +1,52 @@
+{{>header}}
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/serializer.dart';
+import 'package:time_machine/time_machine.dart';
+
+class OffsetDateSerializer implements PrimitiveSerializer {
+
+ const OffsetDateSerializer();
+
+ @override
+ Iterable get types => BuiltList.of([OffsetDate]);
+
+ @override
+ String get wireName => 'OffsetDate';
+
+ @override
+ OffsetDate deserialize(Serializers serializers, Object serialized,
+ {FullType specifiedType = FullType.unspecified}) {
+ final local = LocalDate.dateTime(DateTime.parse(serialized as String));
+ return OffsetDate(local, Offset(0));
+ }
+
+ @override
+ Object serialize(Serializers serializers, OffsetDate offsetDate,
+ {FullType specifiedType = FullType.unspecified}) {
+ return offsetDate.toString('yyyy-MM-dd');
+ }
+}
+
+class OffsetDateTimeSerializer implements PrimitiveSerializer {
+
+ const OffsetDateTimeSerializer();
+
+ @override
+ Iterable get types => BuiltList([OffsetDateTime]);
+
+ @override
+ String get wireName => 'OffsetDateTime';
+
+ @override
+ OffsetDateTime deserialize(Serializers serializers, Object serialized,
+ {FullType specifiedType = FullType.unspecified}) {
+ final local = LocalDateTime.dateTime(DateTime.parse(serialized as String));
+ return OffsetDateTime(local, Offset(0));
+ }
+
+ @override
+ Object serialize(Serializers serializers, OffsetDateTime offsetDateTime,
+ {FullType specifiedType = FullType.unspecified}) {
+ return offsetDateTime.toString();
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/recursion_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/recursion_enum_inline.mustache
new file mode 100644
index 000000000000..b6c8bb4bcc98
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/recursion_enum_inline.mustache
@@ -0,0 +1,12 @@
+{{^isModel}}
+{{#enumName}}
+{{^isContainer}}
+{{>serialization/built_value/enum_inline}}
+{{/isContainer}}
+{{#isContainer}}
+ {{#items}}
+{{>serialization/built_value/recursion_enum_inline}}
+ {{/items}}
+{{/isContainer}}
+{{/enumName}}
+{{/isModel}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_construction.mustache
new file mode 100644
index 000000000000..08ea99a41dc5
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_construction.mustache
@@ -0,0 +1 @@
+BuiltValueJsonRepository(standardSerializers)
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache
new file mode 100644
index 000000000000..2c7beee1e417
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache
@@ -0,0 +1,48 @@
+{{>header}}
+import 'dart:async';
+import 'dart:convert';
+import 'dart:typed_data';
+
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/serializer.dart';
+import 'package:dio/dio.dart';
+import 'repository_base.dart';
+import 'serializers.dart';
+
+/// Converts our `TypeInfo` to `built_value`'s `FullType`
+FullType typeInfoToFullType(TypeInfo info) {
+ if (info.nullable) {
+ return FullType.nullable(
+ info.root, info.parameters.map(typeInfoToFullType).toList(),);
+ } else {
+ return FullType(
+ info.root, info.parameters.map(typeInfoToFullType).toList(),);
+ }
+}
+
+class BuiltValueJsonRepository extends SerializationRepositoryBase {
+ final Serializers serializers;
+ const BuiltValueJsonRepository(this.serializers);
+
+ @override
+ FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context}) {
+ if (value is T) {
+ return value;
+ }
+ return serializers.deserialize(
+ value,
+ specifiedType: typeInfoToFullType(targetTypeInfo),
+ ) as T;
+ }
+
+ @override
+ FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context}) {
+ if (src == null) {
+ return null;
+ }
+ return serializers.serialize(
+ src,
+ specifiedType: typeInfoToFullType(inputTypeInfo),
+ ) as Object;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/serializers.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/serializers.mustache
new file mode 100644
index 000000000000..4cb672f0bc5f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/serializers.mustache
@@ -0,0 +1,37 @@
+{{>header}}
+// ignore_for_file: unused_import
+
+import 'package:one_of_serializer/any_of_serializer.dart';
+import 'package:one_of_serializer/one_of_serializer.dart';
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/json_object.dart';
+import 'package:built_value/serializer.dart';
+import 'package:built_value/standard_json_plugin.dart';
+import 'package:{{pubName}}/apis.dart';
+{{#useDateLibCore}}import 'package:built_value/iso_8601_date_time_serializer.dart';{{/useDateLibCore}}
+{{#useDateLibTimeMachine}}import 'package:time_machine/time_machine.dart';
+import 'package:{{pubName}}/{{sourceFolder}}/offset_date_serializer.dart';{{/useDateLibTimeMachine}}
+import 'package:{{pubName}}/models.dart';{{#builtValueSerializerImports}}import '{{{.}}}';
+{{/builtValueSerializerImports}}
+
+part 'serializers.g.dart';
+
+@SerializersFor([{{#models}}{{#model}}
+ {{classname}},{{#vendorExtensions.x-is-parent}}${{classname}},{{/vendorExtensions.x-is-parent}}{{/model}}{{/models}}
+])
+Serializers serializers = (_$serializers.toBuilder(){{#builtValueSerializers}}
+ ..addBuilderFactory(
+ const {{>serialization/built_value/variable_serializer_type}},
+ () => {{>serialization/built_value/variable_builder_type}},
+ ){{/builtValueSerializers}}
+ {{#models}}{{#model}}{{#vendorExtensions.x-is-parent}}..add({{classname}}.serializer)
+ {{/vendorExtensions.x-is-parent}}{{/model}}{{/models}}..add(const OneOfSerializer())
+ ..add(const AnyOfSerializer()){{#useDateLibTimeMachine}}
+ ..add(const OffsetDateSerializer())
+ ..add(const OffsetDateTimeSerializer()){{/useDateLibTimeMachine}}{{#useDateLibCore}}
+ ..add(const DateSerializer())
+ ..add(Iso8601DateTimeSerializer())){{/useDateLibCore}}
+ .build();
+
+Serializers standardSerializers =
+ (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build();
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/test_instance.mustache
new file mode 100644
index 000000000000..993f5db1d64f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/test_instance.mustache
@@ -0,0 +1,2 @@
+ {{#vendorExtensions.x-is-parent}}//{{/vendorExtensions.x-is-parent}}final instance = {{{classname}}}Builder();
+ // add properties to the builder and call build()
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_builder_type.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_builder_type.mustache
new file mode 100644
index 000000000000..87e6197af25f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_builder_type.mustache
@@ -0,0 +1 @@
+{{#isContainer}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}{{#isMap}}Map{{/isMap}}Builder<{{#isMap}}String, {{/isMap}}{{#items}}{{>types/recursion_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}}{{/isContainer}}{{#isNullable}}?{{/isNullable}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_serializer_type.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_serializer_type.mustache
new file mode 100644
index 000000000000..3ebd82b55cac
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_serializer_type.mustache
@@ -0,0 +1 @@
+FullType{{#isNullable}}.nullable{{/isNullable}}({{#isContainer}}{{containerType}}, [{{#isMap}}FullType(String), {{/isMap}}{{#items}}{{>serialization/built_value/variable_serializer_type}}{{/items}}]{{/isContainer}}{{^isContainer}}{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}}{{/isContainer}})
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/build.yaml.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/build.yaml.mustache
new file mode 100644
index 000000000000..89a4dd6e1c2e
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/build.yaml.mustache
@@ -0,0 +1,18 @@
+targets:
+ $default:
+ builders:
+ json_serializable:
+ options:
+ # Options configure how source code is generated for every
+ # `@JsonSerializable`-annotated class in the package.
+ #
+ # The default value for each is listed.
+ any_map: false
+ checked: true
+ create_factory: true
+ create_to_json: true
+ disallow_unrecognized_keys: true
+ explicit_to_json: true
+ field_rename: none
+ ignore_unannotated: false
+ include_if_null: false
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/class.mustache
new file mode 100644
index 000000000000..4bc0161261e5
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/class.mustache
@@ -0,0 +1,99 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part '{{classFilename}}.g.dart';
+
+{{!
+ Classes with polymorphism or composition may generate unused imports,
+ these need to be ignored for said classes so that there are no lint errors.
+}}
+{{#parentModel}}
+// ignore_for_file: unused_import
+
+{{/parentModel}}
+
+{{#isDeprecated}}
+@Deprecated('{{{classname}}} has been deprecated')
+{{/isDeprecated}}
+@JsonSerializable(
+ checked: true,
+ createToJson: true,
+ disallowUnrecognizedKeys: false,
+ explicitToJson: true,
+)
+class {{{classname}}} {
+{{>serialization/json_serializable/dart_constructor}}
+
+{{#vars}}
+ {{#description}}
+ /// {{{description}}}
+ {{/description}}
+ {{^isEnum}}
+ {{#minimum}}
+ // minimum: {{{minimum}}}
+ {{/minimum}}
+ {{#maximum}}
+ // maximum: {{{maximum}}}
+ {{/maximum}}
+ {{/isEnum}}
+ {{#deprecated}}
+ @Deprecated('{{{name}}} has been deprecated')
+ {{/deprecated}}
+ {{^isBinary}}
+ @JsonKey(
+ {{#defaultValue}}defaultValue: {{{defaultValue}}},{{/defaultValue}}
+ name: r'{{{baseName}}}',
+ required: {{#required}}true{{/required}}{{^required}}false{{/required}},
+ includeIfNull: {{#required}}{{#isNullable}}true{{/isNullable}}false{{/required}}{{^required}}false{{/required}}
+ )
+ {{/isBinary}}
+ {{#isBinary}}
+ @JsonKey(ignore: true)
+ {{/isBinary}}
+
+
+ {{#required}}
+ {{#finalProperties}}final {{/finalProperties}}{{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{{name}}};
+ {{/required}}
+ {{^required}}
+ {{#finalProperties}}final {{/finalProperties}}{{{datatypeWithEnum}}}? {{{name}}};
+ {{/required}}
+
+
+
+{{/vars}}
+ @override
+ bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} &&
+ {{#vars}}
+ other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}}
+ {{/vars}}
+
+ @override
+ int get hashCode =>
+ {{#vars}}
+ {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}}
+ {{/vars}}
+
+ factory {{{classname}}}.fromJson(Map json) => _${{{classname}}}FromJson(json);
+
+ Map toJson() => _${{{classname}}}ToJson(this);
+
+ @override
+ String toString() {
+ return toJson().toString();
+ }
+
+}
+{{#vars}}
+ {{#isEnum}}
+ {{^isContainer}}
+
+{{>serialization/json_serializable/enum_inline}}
+ {{/isContainer}}
+ {{#isContainer}}
+ {{#mostInnerItems}}
+
+{{>serialization/json_serializable/enum_inline}}
+ {{/mostInnerItems}}
+ {{/isContainer}}
+ {{/isEnum}}
+{{/vars}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/dart_constructor.mustache
new file mode 100644
index 000000000000..3b99f0c54016
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/dart_constructor.mustache
@@ -0,0 +1,11 @@
+ /// Returns a new [{{{classname}}}] instance.
+ {{{classname}}}({
+ {{#vars}}
+
+ {{!
+ A field is required in Dart when it is
+ required && !defaultValue in OAS
+ }}
+ {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}} this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}},
+ {{/vars}}
+ });
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum.mustache
new file mode 100644
index 000000000000..dbb1ed2cd22a
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum.mustache
@@ -0,0 +1,17 @@
+import 'package:json_annotation/json_annotation.dart';
+
+{{#description}}/// {{{description}}}{{/description}}
+{{#isDeprecated}}
+@Deprecated('{{{classname}}} has been deprecated')
+{{/isDeprecated}}
+enum {{{classname}}} {
+{{#allowableValues}}
+{{#enumVars}}
+ {{#description}}
+ /// {{{.}}}
+ {{/description}}
+ @JsonValue({{#isString}}r{{/isString}}{{{value}}})
+ {{{name}}},
+{{/enumVars}}
+{{/allowableValues}}
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum_inline.mustache
new file mode 100644
index 000000000000..53cd77098740
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum_inline.mustache
@@ -0,0 +1,14 @@
+{{#enumName}}
+{{#description}}/// {{{description}}}{{/description}}
+{{#isDeprecated}}
+@Deprecated('{{{enumName}}} has been deprecated')
+{{/isDeprecated}}
+enum {{{ enumName }}} {
+{{#allowableValues}}
+{{#enumVars}}
+ @JsonValue({{#isString}}r{{/isString}}{{{value}}})
+ {{{name}}},
+{{/enumVars}}
+{{/allowableValues}}
+}
+{{/enumName}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_construction.mustache
new file mode 100644
index 000000000000..f4c0803bc604
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_construction.mustache
@@ -0,0 +1 @@
+JsonSerializableRepository()
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache
new file mode 100644
index 000000000000..85b20e8b3ae3
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache
@@ -0,0 +1,122 @@
+import 'dart:convert';
+import 'dart:async';
+import 'dart:typed_data';
+import 'repository_base.dart';
+import 'package:{{pubName}}/models.dart';
+
+class JsonSerializableRepository extends SerializationRepositoryBase {
+ JsonSerializableRepository();
+
+ /// Transforms an object of arbitrary type [T] (whose information is passed in inputTypeInfo) to a dart primitive
+ @override
+ FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context}) {
+ if (src == null) {
+ return null;
+ }
+ if (src is String) {
+ return src;
+ }
+ if (src is bool) {
+ return src;
+ }
+ if (src is DateTime) {
+ return src.toIso8601String();
+ }
+ if (src is num) {
+ return src;
+ }
+ if (src is Uint8List) {
+ return src;
+ }
+ if (src is Iterable) {
+ return src.map((value) => serialize(value, inputTypeInfo.parameters[0], context: context)).toList();
+ }
+ if (src is Map) {
+ return src.map((key,value) => MapEntry(
+ //Json Map keys must always be strings
+ serialize(key, inputTypeInfo.parameters[0], context: context).toString(),
+ serialize(value, inputTypeInfo.parameters[1], context: context)
+ ));
+ }
+
+ if (context is Object? Function(Object?)) {
+ return context(src);
+ }
+
+ try {
+ return (src as dynamic).toJson();
+ } on NoSuchMethodError {
+ assert(false,
+ '''
+ Failed to serialize the object properly, falling back to `toString()`
+ ''');
+ return src.toString();
+ }
+ }
+
+ /// Transforms a dart primitive to an object of arbitrary type [T] (whose information is passed in inputTypeInfo)
+ @override
+ T deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context}) {
+ //Don't rely on T being accurate here, since it won't get passed for generic arguments.
+ if (value == null) {
+ return null as T;
+ }
+ final targetRootType = targetTypeInfo.root;
+ if (targetRootType == T) {
+ //short circuit if we already have the output as the input
+ return value as T;
+ }
+ switch (targetRootType) {
+ case String:
+ return value.toString() as T;
+ case double:
+ return (value is num ? value.toDouble() : double.tryParse(value.toString())) as T;
+ case int:
+ return (value is num ? value.toInt() : int.tryParse(value.toString())) as T;
+ case num:
+ return (value is num ? value : num.tryParse(value.toString())) as T;
+ case bool:
+ return (value is bool ? value : bool.tryParse(value.toString())) as T;
+ case DateTime:
+ return (value is DateTime ? value : DateTime.tryParse(value.toString())) as T;
+ case Iterable:
+ case List:
+ case Set:
+ if (value is! Iterable) {
+ throw Exception('Cannot deserialize');
+ }
+ final mappedItems = value.map((v) => deserialize(v, targetTypeInfo.parameters[0], context: context));
+ if (targetRootType == List) {
+ return List.from(mappedItems);
+ } else if (targetRootType == Set) {
+ return Set.from(mappedItems);
+ } else if (targetRootType == Iterable) {
+ return mappedItems;
+ } else {
+ throw Exception('Cannot deserialize');
+ }
+ case Map:
+ if (value is! Map) {
+ throw Exception('Cannot deserialize');
+ }
+ return value.map((k,v) => MapEntry(deserialize(k, targetTypeInfo.parameters[0], context: context),deserialize(v, targetTypeInfo.parameters[1], context: context)));
+ {{#models}}
+ {{#model}}
+ case {{{classname}}}:
+ {{#isEnum}}
+ //TODO: find a way to support enums
+ return value as T;
+ {{/isEnum}}
+ {{^isEnum}}
+ return {{{classname}}}.fromJson(value as Map) as T;
+ {{/isEnum}}
+ {{/model}}
+ {{/models}}
+ default:
+ if (value is T) {
+ return value;
+ }
+ throw Exception('Cannot deserialize');
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/test_instance.mustache
new file mode 100644
index 000000000000..489ed278e439
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/test_instance.mustache
@@ -0,0 +1,2 @@
+ final {{{classname}}}? instance = /* {{{classname}}}(...) */ null;
+ // add properties to the entity
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/recursion_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/recursion_enum_inline.mustache
new file mode 100644
index 000000000000..30786f599443
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/recursion_enum_inline.mustache
@@ -0,0 +1,12 @@
+{{^isModel}}
+{{#enumName}}
+{{^isContainer}}
+{{#includeSerializationTemplate}}enum_inline{{/includeSerializationTemplate}}
+{{/isContainer}}
+{{#isContainer}}
+ {{#items}}
+{{>serialization/recursion_enum_inline}}
+ {{/items}}
+{{/isContainer}}
+{{/enumName}}
+{{/isModel}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache
new file mode 100644
index 000000000000..fa1f81f13c5b
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache
@@ -0,0 +1,60 @@
+import 'dart:async';
+
+/// The general rule for implementing this class is
+/// json == serialize(deserialize(json))
+/// object == deserialize(serialize(object))
+/// Where json in this context means a dart primitive
+/// JSON = String | num | bool | null | Uint8List | List | Map
+abstract class SerializationRepositoryBase {
+ const SerializationRepositoryBase();
+
+ FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context,});
+ FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context,});
+}
+
+/// A modified version of `built_value`'s `FullType` class, found here
+/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart
+/// It holds type information known by the spec (including generic type parameters)
+class TypeInfo {
+ final Type root;
+ final bool nullable;
+ final List parameters;
+
+ /// The [Object] type.
+ static const TypeInfo object = TypeInfo(Object);
+
+ const TypeInfo(this.root, [this.parameters = const []]) : nullable = false;
+ const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true;
+
+ @override
+ bool operator ==(dynamic other) {
+ if (identical(other, this)) return true;
+ if (other is! TypeInfo) return false;
+ if (root != other.root) return false;
+ if (nullable != other.nullable) return false;
+ if (parameters.length != other.parameters.length) return false;
+ for (var i = 0; i != parameters.length; ++i) {
+ if (parameters[i] != other.parameters[i]) return false;
+ }
+ return true;
+ }
+
+ @override
+ int get hashCode {
+ return Object.hash(root, Object.hashAll(parameters), nullable);
+ }
+
+ @override
+ String toString() => (parameters.isEmpty
+ ? _getRawName(root)
+ : '${_getRawName(root)}<${parameters.join(", ")}>') +
+ _nullabilitySuffix;
+
+ String get _nullabilitySuffix => nullable ? '?' : '';
+
+ static String _getRawName(Type? type) {
+ var name = type.toString();
+ var genericsStart = name.indexOf('<');
+ return genericsStart == -1 ? name : name.substring(0, genericsStart);
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type.mustache b/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type.mustache
new file mode 100644
index 000000000000..8b15970ec9aa
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type.mustache
@@ -0,0 +1 @@
+{{#isContainer}}{{containerType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>types/recursion_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}}{{/isContainer}}{{#isNullable}}?{{/isNullable}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type_info.mustache b/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type_info.mustache
new file mode 100644
index 000000000000..4eb44953b8df
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type_info.mustache
@@ -0,0 +1,9 @@
+const TypeInfo{{#isNullable}}.nullable{{/isNullable}}(
+ {{#isContainer}}{{containerType}}, [
+ {{#isMap}}TypeInfo(String), {{/isMap}}
+ {{#items}}{{>types/recursion_type_info}}{{/items}},
+ ]{{/isContainer}}{{^isContainer}}
+ {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}
+ {{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}}
+ {{/isContainer}})
+
diff --git a/modules/openapi-generator/src/main/resources/dart-next/types/required.mustache b/modules/openapi-generator/src/main/resources/dart-next/types/required.mustache
new file mode 100644
index 000000000000..bcf4538e8b3e
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/dart-next/types/required.mustache
@@ -0,0 +1,15 @@
+{{!
+ a parameter is removed in dart json if its OAS properties are:
+ 1. not required + has null value
+
+ a parameter is nullable in dart if its OAS properties are:
+ 1. nullable
+ 2. non-nullable + no default value + not required
+
+ a parameter is required in dart if its OAS properties are:
+ 1. no default value + non-nullable
+ 2. no default value + nullable + required
+
+ as a general rule, a required paramter can't have a default value, since it will throw a syntax error.
+}}
+{{^defaultValue}}{{#isNullable}}{{#required}}required{{/required}}{{/isNullable}}{{^isNullable}}required{{/isNullable}}{{/defaultValue}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientCodegenTest.java
new file mode 100644
index 000000000000..8611a8040de0
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientCodegenTest.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.dart.next;
+
+import org.openapitools.codegen.ClientOptInput;
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.DefaultGenerator;
+import org.openapitools.codegen.Generator;
+import org.openapitools.codegen.TestUtils;
+import org.openapitools.codegen.config.CodegenConfigurator;
+import org.openapitools.codegen.languages.DartNextClientCodegen;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+public class DartNextClientCodegenTest {
+
+ @Test
+ public void testInitialConfigValues() throws Exception {
+ final DartNextClientCodegen codegen = new DartNextClientCodegen();
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE);
+ Assert.assertTrue(codegen.isHideGenerationTimestamp());
+ }
+
+ @Test
+ public void testInitialFeatures() {
+ final DartNextClientCodegen codegen = new DartNextClientCodegen();
+ codegen.processOpts();
+
+ Assert.assertNotNull(codegen.getFeatureSet().getSecurityFeatures());
+ Assert.assertFalse(codegen.getFeatureSet().getSecurityFeatures().isEmpty());
+ }
+
+ @Test
+ public void testSettersForConfigValues() throws Exception {
+ final DartNextClientCodegen codegen = new DartNextClientCodegen();
+ codegen.setHideGenerationTimestamp(false);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertFalse(codegen.isHideGenerationTimestamp());
+ }
+
+ @Test
+ public void testAdditionalPropertiesPutForConfigValues() throws Exception {
+ final DartNextClientCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE);
+ Assert.assertFalse(codegen.isHideGenerationTimestamp());
+ }
+
+ @Test
+ public void testKeywords() {
+ final DartNextClientCodegen codegen = new DartNextClientCodegen();
+
+ List reservedWordsList = new ArrayList<>();
+ try {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), StandardCharsets.UTF_8));
+ while(reader.ready()) { reservedWordsList.add(reader.readLine()); }
+ reader.close();
+ } catch (Exception e) {
+ String errorString = String.format(Locale.ROOT, "Error reading dart keywords: %s", e);
+ Assert.fail(errorString, e);
+ }
+
+ Assert.assertTrue(reservedWordsList.size() > 20);
+ Assert.assertEquals(codegen.reservedWords().size(), reservedWordsList.size());
+ for(String keyword : reservedWordsList) {
+ // reserved words are stored in lowercase
+ Assert.assertTrue(codegen.reservedWords().contains(keyword.toLowerCase(Locale.ROOT)), String.format(Locale.ROOT, "%s, part of %s, was not found in %s", keyword, reservedWordsList, codegen.reservedWords().toString()));
+ }
+ }
+
+ @Test
+ public void verifyDartNextGeneratorRuns() throws IOException {
+ File output = Files.createTempDirectory("test").toFile();
+ output.deleteOnExit();
+
+ final CodegenConfigurator configurator = new CodegenConfigurator()
+ .setGeneratorName("dart-next")
+ .setGitUserId("my-user")
+ .setGitRepoId("my-repo")
+ .setPackageName("my-package")
+ .setInputSpec("src/test/resources/3_0/petstore.yaml")
+ .setOutputDir(output.getAbsolutePath().replace("\\", "/"));
+
+ ClientOptInput opts = configurator.toClientOptInput();
+
+ Generator generator = new DefaultGenerator().opts(opts);
+ List files = generator.generate();
+ files.forEach(File::deleteOnExit);
+
+ TestUtils.ensureContainsFile(files, output, "README.md");
+ TestUtils.ensureContainsFile(files, output, "lib/apis.dart");
+ }
+}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientOptionsTest.java
new file mode 100644
index 000000000000..bc49b234cebf
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientOptionsTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.dart.next;
+
+import org.openapitools.codegen.AbstractOptionsTest;
+import org.openapitools.codegen.CodegenConfig;
+import org.openapitools.codegen.languages.DartNextClientCodegen;
+import org.openapitools.codegen.options.DartNextClientOptionsProvider;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+public class DartNextClientOptionsTest extends AbstractOptionsTest {
+ private DartNextClientCodegen clientCodegen = mock(DartNextClientCodegen.class, mockSettings);
+
+ public DartNextClientOptionsTest() {
+ super(new DartNextClientOptionsProvider());
+ }
+
+ @Override
+ protected CodegenConfig getCodegenConfig() {
+ return clientCodegen;
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ protected void verifyOptions() {
+ verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(DartNextClientOptionsProvider.SORT_PARAMS_VALUE));
+ verify(clientCodegen).setPubLibrary(DartNextClientOptionsProvider.PUB_LIBRARY_VALUE);
+ verify(clientCodegen).setPubName(DartNextClientOptionsProvider.PUB_NAME_VALUE);
+ verify(clientCodegen).setPubVersion(DartNextClientOptionsProvider.PUB_VERSION_VALUE);
+ verify(clientCodegen).setPubDescription(DartNextClientOptionsProvider.PUB_DESCRIPTION_VALUE);
+ verify(clientCodegen).setPubAuthor(DartNextClientOptionsProvider.PUB_AUTHOR_VALUE);
+ verify(clientCodegen).setPubAuthorEmail(DartNextClientOptionsProvider.PUB_AUTHOR_EMAIL_VALUE);
+ verify(clientCodegen).setPubHomepage(DartNextClientOptionsProvider.PUB_HOMEPAGE_VALUE);
+ verify(clientCodegen).setPubRepository(DartNextClientOptionsProvider.PUB_REPOSITORY_VALUE);
+ verify(clientCodegen).setPubPublishTo(DartNextClientOptionsProvider.PUB_PUBLISH_TO_VALUE);
+ verify(clientCodegen).setSourceFolder(DartNextClientOptionsProvider.SOURCE_FOLDER_VALUE);
+ verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartNextClientOptionsProvider.USE_ENUM_EXTENSION));
+ verify(clientCodegen).setDateLibrary(DartNextClientCodegen.DATE_LIBRARY_DEFAULT);
+ verify(clientCodegen).setLibrary(DartNextClientCodegen.NETWORKING_LIBRARY_DEFAULT);
+ verify(clientCodegen).setSerializationLibrary(DartNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT);
+ verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartNextClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE));
+ }
+}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java
new file mode 100644
index 000000000000..57de59bbd3a7
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java
@@ -0,0 +1,500 @@
+/*
+ * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.dart.next;
+
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.media.*;
+import org.openapitools.codegen.*;
+import org.openapitools.codegen.languages.DartNextClientCodegen;
+import org.testng.Assert;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+@SuppressWarnings("static-method")
+public class DartNextModelTest {
+
+ @Test(description = "convert a simple model")
+ public void simpleModelTest() {
+ final Schema> model = new Schema()
+ .description("a sample model")
+ .addProperty("id", new IntegerSchema())
+ .addProperty("name", new StringSchema())
+ .addProperty("createdAt", new DateTimeSchema())
+ .addRequiredItem("id")
+ .addRequiredItem("name");
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 3);
+ // {{imports}} is not used in template
+ //Assert.assertEquals(cm.imports.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "id");
+ Assert.assertEquals(property1.dataType, "int");
+ Assert.assertEquals(property1.name, "id");
+ Assert.assertNull(property1.defaultValue);
+ Assert.assertEquals(property1.baseType, "int");
+ Assert.assertTrue(property1.required);
+ Assert.assertTrue(property1.isPrimitiveType);
+ Assert.assertFalse(property1.isContainer);
+
+ final CodegenProperty property2 = cm.vars.get(1);
+ Assert.assertEquals(property2.baseName, "name");
+ Assert.assertEquals(property2.dataType, "String");
+ Assert.assertEquals(property2.name, "name");
+ Assert.assertNull(property2.defaultValue);
+ Assert.assertEquals(property2.baseType, "String");
+ Assert.assertTrue(property2.required);
+ Assert.assertTrue(property2.isPrimitiveType);
+ Assert.assertFalse(property2.isContainer);
+
+ final CodegenProperty property3 = cm.vars.get(2);
+ Assert.assertEquals(property3.baseName, "createdAt");
+ Assert.assertEquals(property3.complexType, "DateTime");
+ Assert.assertEquals(property3.dataType, "DateTime");
+ Assert.assertEquals(property3.name, "createdAt");
+ Assert.assertNull(property3.defaultValue);
+ Assert.assertEquals(property3.baseType, "DateTime");
+ Assert.assertFalse(property3.required);
+ Assert.assertFalse(property3.isContainer);
+ }
+
+ @Test(description = "convert a simple dart-dit model with datelibrary")
+ public void simpleModelWithTimeMachineTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("id", new IntegerSchema())
+ .addProperty("name", new StringSchema())
+ .addProperty("createdAt", new DateTimeSchema())
+ .addProperty("birthDate", new DateSchema())
+ .addRequiredItem("id")
+ .addRequiredItem("name");
+
+ final DartNextClientCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(DartNextClientCodegen.DATE_LIBRARY, DartNextClientCodegen.DATE_LIBRARY_TIME_MACHINE);
+ codegen.processOpts();
+
+ codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model));
+
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 4);
+ // {{imports}} is not used in template
+ //Assert.assertEquals(cm.imports.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "id");
+ Assert.assertEquals(property1.dataType, "int");
+ Assert.assertEquals(property1.name, "id");
+ Assert.assertNull(property1.defaultValue);
+ Assert.assertEquals(property1.baseType, "int");
+ Assert.assertTrue(property1.required);
+ Assert.assertTrue(property1.isPrimitiveType);
+ Assert.assertFalse(property1.isContainer);
+
+ final CodegenProperty property2 = cm.vars.get(1);
+ Assert.assertEquals(property2.baseName, "name");
+ Assert.assertEquals(property2.dataType, "String");
+ Assert.assertEquals(property2.name, "name");
+ Assert.assertNull(property2.defaultValue);
+ Assert.assertEquals(property2.baseType, "String");
+ Assert.assertTrue(property2.required);
+ Assert.assertTrue(property2.isPrimitiveType);
+ Assert.assertFalse(property2.isContainer);
+
+ final CodegenProperty property3 = cm.vars.get(2);
+ Assert.assertEquals(property3.baseName, "createdAt");
+ Assert.assertEquals(property3.complexType, "OffsetDateTime");
+ Assert.assertEquals(property3.dataType, "OffsetDateTime");
+ Assert.assertEquals(property3.name, "createdAt");
+ Assert.assertNull(property3.defaultValue);
+ Assert.assertEquals(property3.baseType, "OffsetDateTime");
+ Assert.assertFalse(property3.required);
+ Assert.assertFalse(property3.isContainer);
+
+ final CodegenProperty property4 = cm.vars.get(3);
+ Assert.assertEquals(property4.baseName, "birthDate");
+ Assert.assertEquals(property4.complexType, "OffsetDate");
+ Assert.assertEquals(property4.dataType, "OffsetDate");
+ Assert.assertEquals(property4.name, "birthDate");
+ Assert.assertNull(property4.defaultValue);
+ Assert.assertEquals(property4.baseType, "OffsetDate");
+ Assert.assertFalse(property4.required);
+ Assert.assertFalse(property4.isContainer);
+ }
+
+ @Test(description = "convert a model with list property")
+ public void listPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("id", new IntegerSchema())
+ .addProperty("urls", new ArraySchema()
+ .items(new StringSchema()))
+ .addRequiredItem("id");
+
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
+ codegen.processOpts();
+
+ codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model));
+
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 2);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "id");
+ Assert.assertEquals(property1.dataType, "int");
+ Assert.assertEquals(property1.name, "id");
+ Assert.assertNull(property1.defaultValue);
+ Assert.assertEquals(property1.baseType, "int");
+ Assert.assertTrue(property1.required);
+ Assert.assertTrue(property1.isPrimitiveType);
+ Assert.assertFalse(property1.isContainer);
+
+ final CodegenProperty property2 = cm.vars.get(1);
+ Assert.assertEquals(property2.baseName, "urls");
+ Assert.assertEquals(property2.dataType, "BuiltList");
+ Assert.assertEquals(property2.name, "urls");
+ Assert.assertEquals(property2.baseType, "BuiltList");
+ //TODO: change this back to array after containerTypeMapped lands
+ Assert.assertEquals(property2.containerType, "BuiltList");
+ Assert.assertFalse(property2.required);
+ Assert.assertTrue(property2.isPrimitiveType);
+ Assert.assertTrue(property2.isContainer);
+ }
+
+ @Test(description = "convert a model with set property")
+ public void setPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("id", new IntegerSchema())
+ .addProperty("urls", new ArraySchema().items(new StringSchema()).uniqueItems(true))
+ .addRequiredItem("id");
+
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
+ codegen.processOpts();
+
+ codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model));
+
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 2);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "id");
+ Assert.assertEquals(property1.dataType, "int");
+ Assert.assertEquals(property1.name, "id");
+ Assert.assertNull(property1.defaultValue);
+ Assert.assertEquals(property1.baseType, "int");
+ Assert.assertTrue(property1.required);
+ Assert.assertTrue(property1.isPrimitiveType);
+ Assert.assertFalse(property1.isContainer);
+
+ final CodegenProperty property2 = cm.vars.get(1);
+ Assert.assertEquals(property2.baseName, "urls");
+ Assert.assertEquals(property2.dataType, "BuiltSet");
+ Assert.assertEquals(property2.name, "urls");
+ Assert.assertEquals(property2.baseType, "BuiltSet");
+ //TODO: change this back to set after containerTypeMapped lands
+ Assert.assertEquals(property2.containerType, "BuiltSet");
+ Assert.assertFalse(property2.required);
+ Assert.assertTrue(property2.isPrimitiveType);
+ Assert.assertTrue(property2.isContainer);
+ }
+
+ @Test(description = "convert a model with a map property")
+ public void mapPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("translations", new MapSchema()
+ .additionalProperties(new StringSchema()))
+ .addRequiredItem("id");
+
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
+ codegen.processOpts();
+
+ codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model));
+
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "translations");
+ Assert.assertEquals(property1.dataType, "BuiltMap");
+ Assert.assertEquals(property1.name, "translations");
+ Assert.assertEquals(property1.baseType, "BuiltMap");
+ //TODO: change this back to map after containerTypeMapped lands
+ Assert.assertEquals(property1.containerType, "BuiltMap");
+ Assert.assertFalse(property1.required);
+ Assert.assertTrue(property1.isContainer);
+ Assert.assertTrue(property1.isPrimitiveType);
+ }
+
+ @Test(description = "convert a model with complex property")
+ public void complexPropertyTest() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("children", new Schema().$ref("#/definitions/Children"));
+
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
+ codegen.processOpts();
+
+ codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model));
+
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "children");
+ Assert.assertEquals(property1.dataType, "Children");
+ Assert.assertEquals(property1.name, "children");
+ Assert.assertEquals(property1.baseType, "Children");
+ Assert.assertFalse(property1.required);
+ Assert.assertFalse(property1.isContainer);
+ }
+
+ @Test(description = "convert a model with complex list property")
+ public void complexListProperty() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("children", new ArraySchema()
+ .items(new Schema().$ref("#/definitions/Children")));
+
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
+ codegen.processOpts();
+
+ codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model));
+
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "children");
+ Assert.assertEquals(property1.dataType, "BuiltList");
+ Assert.assertEquals(property1.name, "children");
+ Assert.assertEquals(property1.baseType, "BuiltList");
+ //TODO: change this back to array after containerTypeMapped lands
+ Assert.assertEquals(property1.containerType, "BuiltList");
+ Assert.assertFalse(property1.required);
+ Assert.assertTrue(property1.isContainer);
+ }
+
+ @Test(description = "convert a model with complex map property")
+ public void complexMapSchema() {
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("children", new MapSchema()
+ .additionalProperties(new Schema().$ref("#/definitions/Children")));
+
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
+ codegen.processOpts();
+
+ codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model));
+
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a sample model");
+ Assert.assertEquals(cm.vars.size(), 1);
+
+ final CodegenProperty property1 = cm.vars.get(0);
+ Assert.assertEquals(property1.baseName, "children");
+ Assert.assertEquals(property1.complexType, "Children");
+ Assert.assertEquals(property1.dataType, "BuiltMap");
+ Assert.assertEquals(property1.name, "children");
+ Assert.assertEquals(property1.baseType, "BuiltMap");
+ //TODO: change this back to array after containerTypeMapped lands
+ Assert.assertEquals(property1.containerType, "BuiltMap");
+ Assert.assertFalse(property1.required);
+ Assert.assertTrue(property1.isContainer);
+ }
+
+ @Test(description = "convert an array model")
+ public void arrayModelTest() {
+ final Schema model = new ArraySchema()
+ .items(new Schema().$ref("#/definitions/Children"))
+ .description("an array model");
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(model.getDescription(), "an array model");
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertTrue(cm.isArray);
+ Assert.assertEquals(cm.description, "an array model");
+ Assert.assertEquals(cm.vars.size(), 0);
+ }
+
+ @Test(description = "convert a map model")
+ public void mapModelTest() {
+ final Schema model = new Schema()
+ .description("a map model")
+ .additionalProperties(new Schema().$ref("#/definitions/Children"));
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ Assert.assertEquals(cm.name, "sample");
+ Assert.assertEquals(cm.classname, "Sample");
+ Assert.assertEquals(cm.description, "a map model");
+ Assert.assertEquals(cm.vars.size(), 0);
+ }
+
+ @DataProvider(name = "modelNames")
+ public static Object[][] modelNames() {
+ return new Object[][] {
+ {"EnumClass", "TestModelEnumClass"},
+ {"JsonObject", "TestModelJsonObject"},
+ };
+ }
+
+ @Test(dataProvider = "modelNames", description = "correctly prefix reserved model names")
+ public void modelNameTest(String name, String expectedName) {
+ OpenAPI openAPI = TestUtils.createOpenAPI();
+ final Schema model = new Schema();
+
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
+ codegen.processOpts();
+ codegen.typeMapping().put("EnumClass", "TestModelEnumClass");
+ codegen.typeMapping().put("JsonObject", "TestModelJsonObject");
+ codegen.setOpenAPI(openAPI);
+
+ final CodegenModel cm = codegen.fromModel(name, model);
+
+ Assert.assertEquals(cm.name, name);
+ Assert.assertEquals(cm.classname, expectedName);
+ }
+
+ @DataProvider(name = "modelNamesTimemachine")
+ public static Object[][] modelNamesTimemachine() {
+ return new Object[][] {
+ {"EnumClass", "TestModelEnumClass"},
+ {"JsonObject", "TestModelJsonObject"},
+ {"OffsetDate", "TestModelOffsetDate"},
+ };
+ }
+
+ @Test(dataProvider = "modelNamesTimemachine", description = "correctly prefix reserved model names")
+ public void modelNameTestTimemachine(String name, String expectedName) {
+ OpenAPI openAPI = TestUtils.createOpenAPI();
+ final Schema model = new Schema();
+ final DartNextClientCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(DartNextClientCodegen.DATE_LIBRARY, DartNextClientCodegen.DATE_LIBRARY_TIME_MACHINE);
+ codegen.processOpts();
+ codegen.typeMapping().put("EnumClass", "TestModelEnumClass");
+ codegen.typeMapping().put("JsonObject", "TestModelJsonObject");
+ codegen.typeMapping().put("OffsetDate", "TestModelOffsetDate");
+ codegen.setOpenAPI(openAPI);
+
+ final CodegenModel cm = codegen.fromModel(name, model);
+
+ Assert.assertEquals(cm.name, name);
+ Assert.assertEquals(cm.classname, expectedName);
+ }
+
+ @Test(description = "correctly generate collection default values")
+ public void collectionDefaultValues() {
+ final ArraySchema array = new ArraySchema();
+ array.setDefault("[]");
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("arrayNoDefault", new ArraySchema())
+ .addProperty("arrayEmptyDefault", array)
+ .addProperty("mapNoDefault", new MapSchema());
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE);
+ codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model));
+ codegen.processOpts();
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ final CodegenProperty arrayNoDefault = cm.vars.get(0);
+ Assert.assertEquals(arrayNoDefault.name, "arrayNoDefault");
+ Assert.assertNull(arrayNoDefault.defaultValue);
+
+ final CodegenProperty arrayEmptyDefault = cm.vars.get(1);
+ Assert.assertEquals(arrayEmptyDefault.name, "arrayEmptyDefault");
+ Assert.assertEquals(arrayEmptyDefault.defaultValue, "ListBuilder()");
+
+ final CodegenProperty mapNoDefault = cm.vars.get(2);
+ Assert.assertEquals(mapNoDefault.name, "mapNoDefault");
+ Assert.assertNull(mapNoDefault.defaultValue);
+ }
+
+ @Test(description = "correctly generate date/datetime default values, currently null")
+ public void dateDefaultValues() {
+ final DateSchema date = new DateSchema();
+ date.setDefault("2021-01-01");
+ final DateTimeSchema dateTime = new DateTimeSchema();
+ dateTime.setDefault("2021-01-01T14:00:00Z");
+ final Schema model = new Schema()
+ .description("a sample model")
+ .addProperty("date", date)
+ .addProperty("dateTime", dateTime)
+ .addProperty("mapNoDefault", new MapSchema());
+ final DefaultCodegen codegen = new DartNextClientCodegen();
+ OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
+ codegen.setOpenAPI(openAPI);
+ final CodegenModel cm = codegen.fromModel("sample", model);
+
+ final CodegenProperty dateDefault = cm.vars.get(0);
+ Assert.assertEquals(dateDefault.name, "date");
+ Assert.assertNull(dateDefault.defaultValue);
+
+ final CodegenProperty dateTimeDefault = cm.vars.get(1);
+ Assert.assertEquals(dateTimeDefault.name, "dateTime");
+ Assert.assertNull(dateTimeDefault.defaultValue);
+ }
+}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartNextClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartNextClientOptionsProvider.java
new file mode 100644
index 000000000000..59f08614fc9a
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartNextClientOptionsProvider.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openapitools.codegen.options;
+
+import com.google.common.collect.ImmutableMap;
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.languages.DartNextClientCodegen;
+
+import java.util.Map;
+
+public class DartNextClientOptionsProvider implements OptionsProvider {
+ public static final String SORT_PARAMS_VALUE = "true";
+ public static final String SORT_MODEL_PROPERTIES_VALUE = "false";
+ public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true";
+ public static final String PUB_LIBRARY_VALUE = "openapi.api";
+ public static final String PUB_NAME_VALUE = "openapi";
+ public static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT";
+ public static final String PUB_DESCRIPTION_VALUE = "OpenAPI API client dart-next";
+ public static final String SOURCE_FOLDER_VALUE = "src";
+ public static final String USE_ENUM_EXTENSION = "true";
+ public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
+ public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true";
+ public static final String PUB_AUTHOR_VALUE = "Author";
+ public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage";
+ public static final String PUB_HOMEPAGE_VALUE = "Homepage";
+ public static final String PUB_REPOSITORY_VALUE = "Repository";
+ public static final String PUB_PUBLISH_TO_VALUE = "Publish to";
+ public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false";
+
+ @Override
+ public String getLanguage() {
+ return "dart-next";
+ }
+
+ @Override
+ public Map createOptions() {
+ ImmutableMap.Builder builder = new ImmutableMap.Builder();
+ return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
+ .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE)
+ .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
+ .put(DartNextClientCodegen.PUB_LIBRARY, PUB_LIBRARY_VALUE)
+ .put(DartNextClientCodegen.PUB_NAME, PUB_NAME_VALUE)
+ .put(DartNextClientCodegen.PUB_VERSION, PUB_VERSION_VALUE)
+ .put(DartNextClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE)
+ .put(DartNextClientCodegen.PUB_AUTHOR, PUB_AUTHOR_VALUE)
+ .put(DartNextClientCodegen.PUB_AUTHOR_EMAIL, PUB_AUTHOR_EMAIL_VALUE)
+ .put(DartNextClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE)
+ .put(DartNextClientCodegen.PUB_REPOSITORY, PUB_REPOSITORY_VALUE)
+ .put(DartNextClientCodegen.PUB_PUBLISH_TO, PUB_PUBLISH_TO_VALUE)
+ .put(CodegenConstants.LIBRARY, DartNextClientCodegen.NETWORKING_LIBRARY_DEFAULT)
+ .put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT)
+ .put(DartNextClientCodegen.DATE_LIBRARY, DartNextClientCodegen.DATE_LIBRARY_DEFAULT)
+ .put(DartNextClientCodegen.FINAL_PROPERTIES, DartNextClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE)
+ .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE)
+ .put(DartNextClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION)
+ .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE)
+ .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)
+ .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true")
+ .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true")
+ .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE)
+ .build();
+ }
+
+ @Override
+ public boolean isServer() {
+ return false;
+ }
+}
diff --git a/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml b/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml
new file mode 100644
index 000000000000..2116b49c5dc0
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml
@@ -0,0 +1,2503 @@
+openapi: 3.0.0
+info:
+ description: >-
+ This spec is mainly for testing Petstore server and contains fake endpoints,
+ models. Please do not use this for any other purpose. Special characters: "
+ \
+ version: 1.0.0
+ title: OpenAPI Petstore
+ license:
+ name: Apache-2.0
+ url: "https://www.apache.org/licenses/LICENSE-2.0.html"
+tags:
+ - name: pet
+ description: Everything about your Pets
+ - name: store
+ description: Access to Petstore orders
+ - name: user
+ description: Operations about user
+ - name: Foo
+ - name: Bar
+paths:
+ /foo:
+ get:
+ tags:
+ - Foo
+ summary: GET all Foos
+ operationId: getAllFoos
+ responses:
+ "200":
+ $ref: "#/components/responses/200FooArray"
+ post:
+ tags:
+ - Foo
+ summary: Create a Foo
+ operationId: createFoo
+ requestBody:
+ $ref: "#/components/requestBodies/Foo"
+ responses:
+ "201":
+ $ref: "#/components/responses/201Foo"
+ /bar:
+ post:
+ tags:
+ - Bar
+ summary: Create a Bar
+ operationId: createBar
+ requestBody:
+ required: true
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Bar_Create"
+ responses:
+ 200:
+ description: Bar created
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Bar"
+
+ /foo-basic:
+ get:
+ responses:
+ default:
+ description: response
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ string:
+ $ref: "#/components/schemas/Foo"
+ /pet:
+ servers:
+ - url: "http://petstore.swagger.io/v2"
+ - url: "http://path-server-test.petstore.local/v2"
+ - url: "http://{server}.swagger.io:{port}/v2"
+ description: test server with variables
+ variables:
+ server:
+ description: target server
+ enum:
+ - "petstore"
+ - "qa-petstore"
+ - "dev-petstore"
+ default: "petstore"
+ port:
+ enum:
+ - "80"
+ - "8080"
+ default: "80"
+ post:
+ tags:
+ - pet
+ summary: Add a new pet to the store
+ description: ""
+ operationId: addPet
+ responses:
+ "200":
+ description: Successful operation
+ "405":
+ description: Invalid input
+ security:
+ - petstore_auth:
+ - "write:pets"
+ - "read:pets"
+ requestBody:
+ $ref: "#/components/requestBodies/Pet"
+ put:
+ tags:
+ - pet
+ summary: Update an existing pet
+ description: ""
+ operationId: updatePet
+ x-webclient-blocking: true
+ responses:
+ "200":
+ description: Successful operation
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Pet not found
+ "405":
+ description: Validation exception
+ security:
+ - petstore_auth:
+ - "write:pets"
+ - "read:pets"
+ requestBody:
+ $ref: "#/components/requestBodies/Pet"
+ /pet/findByStatus:
+ get:
+ tags:
+ - pet
+ summary: Finds Pets by status
+ description: Multiple status values can be provided with comma separated strings
+ operationId: findPetsByStatus
+ x-webclient-blocking: true
+ parameters:
+ - name: status
+ in: query
+ description: Status values that need to be considered for filter
+ required: true
+ style: form
+ explode: false
+ deprecated: true
+ schema:
+ type: array
+ items:
+ type: string
+ enum:
+ - available
+ - pending
+ - sold
+ default: available
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/Pet"
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/Pet"
+ "400":
+ description: Invalid status value
+ security:
+ - petstore_auth:
+ - "write:pets"
+ - "read:pets"
+ /pet/findByTags:
+ get:
+ tags:
+ - pet
+ summary: Finds Pets by tags
+ description: >-
+ Multiple tags can be provided with comma separated strings. Use tag1,
+ tag2, tag3 for testing.
+ operationId: findPetsByTags
+ x-webclient-blocking: true
+ parameters:
+ - name: tags
+ in: query
+ description: Tags to filter by
+ required: true
+ style: form
+ explode: false
+ schema:
+ type: array
+ items:
+ type: string
+ uniqueItems: true
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/Pet"
+ uniqueItems: true
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/Pet"
+ uniqueItems: true
+ "400":
+ description: Invalid tag value
+ security:
+ - petstore_auth:
+ - "write:pets"
+ - "read:pets"
+ deprecated: true
+ "/pet/{petId}":
+ get:
+ tags:
+ - pet
+ summary: Find pet by ID
+ description: Returns a single pet
+ operationId: getPetById
+ x-webclient-blocking: true
+ parameters:
+ - name: petId
+ in: path
+ description: ID of pet to return
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Pet not found
+ security:
+ - api_key: []
+ post:
+ tags:
+ - pet
+ summary: Updates a pet in the store with form data
+ description: ""
+ operationId: updatePetWithForm
+ parameters:
+ - name: petId
+ in: path
+ description: ID of pet that needs to be updated
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ "200":
+ description: Successful operation
+ "405":
+ description: Invalid input
+ security:
+ - petstore_auth:
+ - "write:pets"
+ - "read:pets"
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ delete:
+ tags:
+ - pet
+ summary: Deletes a pet
+ description: ""
+ operationId: deletePet
+ parameters:
+ - name: api_key
+ in: header
+ required: false
+ schema:
+ type: string
+ - name: petId
+ in: path
+ description: Pet id to delete
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ "200":
+ description: Successful operation
+ "400":
+ description: Invalid pet value
+ security:
+ - petstore_auth:
+ - "write:pets"
+ - "read:pets"
+ "/pet/{petId}/uploadImage":
+ post:
+ tags:
+ - pet
+ summary: uploads an image
+ description: ""
+ operationId: uploadFile
+ parameters:
+ - name: petId
+ in: path
+ description: ID of pet to update
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiResponse"
+ security:
+ - petstore_auth:
+ - "write:pets"
+ - "read:pets"
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ file:
+ description: file to upload
+ type: string
+ format: binary
+ /store/inventory:
+ get:
+ tags:
+ - store
+ summary: Returns pet inventories by status
+ description: Returns a map of status codes to quantities
+ operationId: getInventory
+ x-webclient-blocking: false
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: object
+ additionalProperties:
+ type: integer
+ format: int32
+ security:
+ - api_key: []
+ /store/order:
+ post:
+ tags:
+ - store
+ summary: Place an order for a pet
+ description: ""
+ operationId: placeOrder
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ $ref: "#/components/schemas/Order"
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Order"
+ "400":
+ description: Invalid Order
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Order"
+ description: order placed for purchasing the pet
+ required: true
+ "/store/order/{order_id}":
+ get:
+ tags:
+ - store
+ summary: Find purchase order by ID
+ description: >-
+ For valid response try integer IDs with value <= 5 or > 10. Other values
+ will generate exceptions
+ operationId: getOrderById
+ parameters:
+ - name: order_id
+ in: path
+ description: ID of pet that needs to be fetched
+ required: true
+ schema:
+ type: integer
+ format: int64
+ minimum: 1
+ maximum: 5
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ $ref: "#/components/schemas/Order"
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Order"
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Order not found
+ delete:
+ tags:
+ - store
+ summary: Delete purchase order by ID
+ description: >-
+ For valid response try integer IDs with value < 1000. Anything above
+ 1000 or nonintegers will generate API errors
+ operationId: deleteOrder
+ parameters:
+ - name: order_id
+ in: path
+ description: ID of the order that needs to be deleted
+ required: true
+ schema:
+ type: string
+ responses:
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Order not found
+ /user:
+ post:
+ tags:
+ - user
+ summary: Create user
+ description: This can only be done by the logged in user.
+ operationId: createUser
+ responses:
+ default:
+ description: successful operation
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/User"
+ description: Created user object
+ required: true
+ /user/createWithArray:
+ post:
+ tags:
+ - user
+ summary: Creates list of users with given input array
+ description: ""
+ operationId: createUsersWithArrayInput
+ responses:
+ default:
+ description: successful operation
+ requestBody:
+ $ref: "#/components/requestBodies/UserArray"
+ /user/createWithList:
+ post:
+ tags:
+ - user
+ summary: Creates list of users with given input array
+ description: ""
+ operationId: createUsersWithListInput
+ responses:
+ default:
+ description: successful operation
+ requestBody:
+ $ref: "#/components/requestBodies/UserArray"
+ /user/login:
+ get:
+ tags:
+ - user
+ summary: Logs user into the system
+ description: ""
+ operationId: loginUser
+ parameters:
+ - name: username
+ in: query
+ description: The user name for login
+ required: true
+ schema:
+ type: string
+ - name: password
+ in: query
+ description: The password for login in clear text
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: successful operation
+ headers:
+ X-Rate-Limit:
+ description: calls per hour allowed by the user
+ schema:
+ type: integer
+ format: int32
+ X-Expires-After:
+ description: date in UTC when token expires
+ schema:
+ type: string
+ format: date-time
+ content:
+ application/xml:
+ schema:
+ type: string
+ application/json:
+ schema:
+ type: string
+ "400":
+ description: Invalid username/password supplied
+ /user/logout:
+ get:
+ tags:
+ - user
+ summary: Logs out current logged in user session
+ description: ""
+ operationId: logoutUser
+ responses:
+ default:
+ description: successful operation
+ "/user/{username}":
+ get:
+ tags:
+ - user
+ summary: Get user by user name
+ description: ""
+ operationId: getUserByName
+ parameters:
+ - name: username
+ in: path
+ description: The name that needs to be fetched. Use user1 for testing.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/xml:
+ schema:
+ $ref: "#/components/schemas/User"
+ application/json:
+ schema:
+ $ref: "#/components/schemas/User"
+ "400":
+ description: Invalid username supplied
+ "404":
+ description: User not found
+ put:
+ tags:
+ - user
+ summary: Updated user
+ description: This can only be done by the logged in user.
+ operationId: updateUser
+ parameters:
+ - name: username
+ in: path
+ description: name that need to be deleted
+ required: true
+ schema:
+ type: string
+ responses:
+ "400":
+ description: Invalid user supplied
+ "404":
+ description: User not found
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/User"
+ description: Updated user object
+ required: true
+ delete:
+ tags:
+ - user
+ summary: Delete user
+ description: This can only be done by the logged in user.
+ operationId: deleteUser
+ parameters:
+ - name: username
+ in: path
+ description: The name that needs to be deleted
+ required: true
+ schema:
+ type: string
+ responses:
+ "400":
+ description: Invalid username supplied
+ "404":
+ description: User not found
+ /fake_classname_test:
+ patch:
+ tags:
+ - "fake_classname_tags 123#$%^"
+ summary: To test class name in snake case
+ description: To test class name in snake case
+ operationId: testClassname
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Client"
+ security:
+ - api_key_query: []
+ requestBody:
+ $ref: "#/components/requestBodies/Client"
+ /fake:
+ patch:
+ tags:
+ - fake
+ summary: To test "client" model
+ description: To test "client" model
+ operationId: testClientModel
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Client"
+ requestBody:
+ $ref: "#/components/requestBodies/Client"
+ get:
+ tags:
+ - fake
+ summary: To test enum parameters
+ description: To test enum parameters
+ operationId: testEnumParameters
+ parameters:
+ - name: enum_header_string_array
+ in: header
+ description: Header parameter enum test (string array)
+ schema:
+ type: array
+ items:
+ type: string
+ default: $
+ enum:
+ - ">"
+ - $
+ - name: enum_header_string
+ in: header
+ description: Header parameter enum test (string)
+ schema:
+ type: string
+ enum:
+ - _abc
+ - "-efg"
+ - (xyz)
+ default: "-efg"
+ - name: enum_query_string_array
+ in: query
+ description: Query parameter enum test (string array)
+ schema:
+ type: array
+ items:
+ type: string
+ default: $
+ enum:
+ - ">"
+ - $
+ - name: enum_query_string
+ in: query
+ description: Query parameter enum test (string)
+ schema:
+ type: string
+ enum:
+ - _abc
+ - "-efg"
+ - (xyz)
+ default: "-efg"
+ - name: enum_query_integer
+ in: query
+ description: Query parameter enum test (double)
+ schema:
+ type: integer
+ format: int32
+ enum:
+ - 1
+ - -2
+ - name: enum_query_double
+ in: query
+ description: Query parameter enum test (double)
+ schema:
+ type: number
+ format: double
+ enum:
+ - 1.1
+ - -1.2
+ - name: enum_query_model_array
+ in: query
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumClass"
+ responses:
+ "400":
+ description: Invalid request
+ "404":
+ description: Not found
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ enum_form_string_array:
+ description: Form parameter enum test (string array)
+ type: array
+ items:
+ type: string
+ default: $
+ enum:
+ - ">"
+ - $
+ enum_form_string:
+ description: Form parameter enum test (string)
+ type: string
+ enum:
+ - _abc
+ - "-efg"
+ - (xyz)
+ default: "-efg"
+ post:
+ tags:
+ - fake
+ summary: |
+ Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+ description: |
+ Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+ operationId: testEndpointParameters
+ responses:
+ "400":
+ description: Invalid username supplied
+ "404":
+ description: User not found
+ security:
+ - http_basic_test: []
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ integer:
+ description: None
+ type: integer
+ minimum: 10
+ maximum: 100
+ int32:
+ description: None
+ type: integer
+ format: int32
+ minimum: 20
+ maximum: 200
+ int64:
+ description: None
+ type: integer
+ format: int64
+ number:
+ description: None
+ type: number
+ minimum: 32.1
+ maximum: 543.2
+ float:
+ description: None
+ type: number
+ format: float
+ maximum: 987.6
+ double:
+ description: None
+ type: number
+ format: double
+ minimum: 67.8
+ maximum: 123.4
+ string:
+ description: None
+ type: string
+ pattern: "/[a-z]/i"
+ pattern_without_delimiter:
+ description: None
+ type: string
+ pattern: "^[A-Z].*"
+ byte:
+ description: None
+ type: string
+ format: byte
+ binary:
+ description: None
+ type: string
+ format: binary
+ date:
+ description: None
+ type: string
+ format: date
+ dateTime:
+ description: None
+ type: string
+ format: date-time
+ password:
+ description: None
+ type: string
+ format: password
+ minLength: 10
+ maxLength: 64
+ callback:
+ description: None
+ type: string
+ required:
+ - number
+ - double
+ - pattern_without_delimiter
+ - byte
+ delete:
+ tags:
+ - fake
+ security:
+ - bearer_test: []
+ summary: Fake endpoint to test group parameters (optional)
+ description: Fake endpoint to test group parameters (optional)
+ operationId: testGroupParameters
+ x-group-parameters: true
+ parameters:
+ - name: required_string_group
+ in: query
+ description: Required String in group parameters
+ required: true
+ schema:
+ type: integer
+ - name: required_boolean_group
+ in: header
+ description: Required Boolean in group parameters
+ required: true
+ schema:
+ type: boolean
+ - name: required_int64_group
+ in: query
+ description: Required Integer in group parameters
+ required: true
+ schema:
+ type: integer
+ format: int64
+ - name: string_group
+ in: query
+ description: String in group parameters
+ schema:
+ type: integer
+ - name: boolean_group
+ in: header
+ description: Boolean in group parameters
+ schema:
+ type: boolean
+ - name: int64_group
+ in: query
+ description: Integer in group parameters
+ schema:
+ type: integer
+ format: int64
+ responses:
+ "400":
+ description: Something wrong
+ /fake/outer/number:
+ post:
+ tags:
+ - fake
+ description: Test serialization of outer number types
+ operationId: fakeOuterNumberSerialize
+ responses:
+ "200":
+ description: Output number
+ content:
+ "*/*":
+ schema:
+ $ref: "#/components/schemas/OuterNumber"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OuterNumber"
+ description: Input number as post body
+ /fake/property/enum-int:
+ post:
+ tags:
+ - fake
+ description: Test serialization of enum (int) properties with examples
+ operationId: fakePropertyEnumIntegerSerialize
+ responses:
+ "200":
+ description: Output enum (int)
+ content:
+ "*/*":
+ schema:
+ $ref: "#/components/schemas/OuterObjectWithEnumProperty"
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OuterObjectWithEnumProperty"
+ description: Input enum (int) as post body
+ /fake/outer/string:
+ post:
+ tags:
+ - fake
+ description: Test serialization of outer string types
+ operationId: fakeOuterStringSerialize
+ responses:
+ "200":
+ description: Output string
+ content:
+ "*/*":
+ schema:
+ $ref: "#/components/schemas/OuterString"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OuterString"
+ description: Input string as post body
+ /fake/outer/boolean:
+ post:
+ tags:
+ - fake
+ description: Test serialization of outer boolean types
+ operationId: fakeOuterBooleanSerialize
+ responses:
+ "200":
+ description: Output boolean
+ content:
+ "*/*":
+ schema:
+ $ref: "#/components/schemas/OuterBoolean"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OuterBoolean"
+ description: Input boolean as post body
+ /fake/outer/composite:
+ post:
+ tags:
+ - fake
+ description: Test serialization of object with outer number type
+ operationId: fakeOuterCompositeSerialize
+ responses:
+ "200":
+ description: Output composite
+ content:
+ "*/*":
+ schema:
+ $ref: "#/components/schemas/OuterComposite"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OuterComposite"
+ description: Input composite as post body
+ /fake/jsonFormData:
+ get:
+ tags:
+ - fake
+ summary: test json serialization of form data
+ description: ""
+ operationId: testJsonFormData
+ responses:
+ "200":
+ description: successful operation
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ param:
+ description: field1
+ type: string
+ param2:
+ description: field2
+ type: string
+ required:
+ - param
+ - param2
+ /fake/inline-additionalProperties:
+ post:
+ tags:
+ - fake
+ summary: test inline additionalProperties
+ description: ""
+ operationId: testInlineAdditionalProperties
+ responses:
+ "200":
+ description: successful operation
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ additionalProperties:
+ type: string
+ description: request body
+ required: true
+ /fake/body-with-query-params:
+ put:
+ tags:
+ - fake
+ operationId: testBodyWithQueryParams
+ parameters:
+ - name: query
+ in: query
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/User"
+ required: true
+ /another-fake/dummy:
+ patch:
+ tags:
+ - $another-fake?
+ summary: To test special tags
+ description: To test special tags and operation ID starting with number
+ operationId: "123_test_@#$%_special_tags"
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Client"
+ requestBody:
+ $ref: "#/components/requestBodies/Client"
+ /fake/body-with-file-schema:
+ put:
+ tags:
+ - fake
+ description: >-
+ For this test, the body for this request must reference a schema named
+ `File`.
+ operationId: testBodyWithFileSchema
+ responses:
+ "200":
+ description: Success
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/FileSchemaTestClass"
+ required: true
+ /fake/body-with-binary:
+ put:
+ tags:
+ - fake
+ description: >-
+ For this test, the body has to be a binary file.
+ operationId: testBodyWithBinary
+ responses:
+ "200":
+ description: Success
+ requestBody:
+ content:
+ image/png:
+ schema:
+ type: string
+ nullable: true
+ format: binary
+ description: image to upload
+ required: true
+ /fake/test-query-parameters:
+ put:
+ tags:
+ - fake
+ description: To test the collection format in query parameters
+ operationId: testQueryParameterCollectionFormat
+ parameters:
+ - name: pipe
+ in: query
+ required: true
+ style: pipeDelimited
+ schema:
+ type: array
+ items:
+ type: string
+ - name: ioutil
+ in: query
+ required: true
+ style: form
+ explode: false
+ schema:
+ type: array
+ items:
+ type: string
+ - name: http
+ in: query
+ required: true
+ style: spaceDelimited
+ schema:
+ type: array
+ items:
+ type: string
+ - name: url
+ in: query
+ required: true
+ style: form
+ explode: false
+ schema:
+ type: array
+ items:
+ type: string
+ - name: context
+ in: query
+ required: true
+ explode: true
+ schema:
+ type: array
+ items:
+ type: string
+ - name: language
+ in: query
+ required: false
+ schema:
+ type: object
+ additionalProperties:
+ type: string
+ format: string
+ - name: allowEmpty
+ in: query
+ required: true
+ allowEmptyValue: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ "/fake/{petId}/uploadImageWithRequiredFile":
+ post:
+ tags:
+ - pet
+ summary: uploads an image (required)
+ description: ""
+ operationId: uploadFileWithRequiredFile
+ parameters:
+ - name: petId
+ in: path
+ description: ID of pet to update
+ required: true
+ schema:
+ type: integer
+ format: int64
+ responses:
+ "200":
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiResponse"
+ security:
+ - petstore_auth:
+ - "write:pets"
+ - "read:pets"
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ requiredFile:
+ description: file to upload
+ type: string
+ format: binary
+ required:
+ - requiredFile
+ /fake/health:
+ get:
+ tags:
+ - fake
+ summary: Health check endpoint
+ responses:
+ 200:
+ description: The instance started successfully
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/HealthCheckResult"
+ /fake/http-signature-test:
+ get:
+ tags:
+ - fake
+ summary: test http signature authentication
+ operationId: fake-http-signature-test
+ parameters:
+ - name: query_1
+ in: query
+ description: query parameter
+ required: false
+ schema:
+ type: string
+ - name: header_1
+ in: header
+ description: header parameter
+ required: false
+ schema:
+ type: string
+ security:
+ - http_signature_test: []
+ requestBody:
+ $ref: "#/components/requestBodies/Pet"
+ responses:
+ 200:
+ description: The instance started successfully
+ /oneof:
+ get:
+ responses:
+ "200":
+ description: desc
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/fruit"
+ /oneof-primitive:
+ get:
+ operationId: list
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GigaOneOf"
+ /variant1:
+ get:
+ responses:
+ "200":
+ description: desc
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/fruitVariant1"
+ put:
+ operationId: test
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema: {}
+ responses:
+ "204":
+ description: Success
+ /variant2:
+ get:
+ responses:
+ "200":
+ description: desc
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/FruitAllOfDisc"
+servers:
+ - url: "http://{server}.swagger.io:{port}/v2"
+ description: petstore server
+ variables:
+ server:
+ enum:
+ - "petstore"
+ - "qa-petstore"
+ - "dev-petstore"
+ default: "petstore"
+ port:
+ enum:
+ - "80"
+ - "8080"
+ default: "80"
+ - url: https://localhost:8080/{version}
+ description: The local server
+ variables:
+ version:
+ enum:
+ - "v1"
+ - "v2"
+ default: "v2"
+ - url: https://127.0.0.1/no_varaible
+ description: The local server without variables
+components:
+ requestBodies:
+ UserArray:
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/User"
+ description: List of user object
+ required: true
+ Client:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Client"
+ description: client model
+ required: true
+ Pet:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ application/xml:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ description: Pet object that needs to be added to the store
+ required: true
+ Foo:
+ description: The Foo to be created
+ content:
+ application/json;charset=utf-8:
+ schema:
+ $ref: "#/components/schemas/Foo"
+ securitySchemes:
+ petstore_auth:
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
+ scopes:
+ "write:pets": modify pets in your account
+ "read:pets": read your pets
+ api_key:
+ type: apiKey
+ name: api_key
+ in: header
+ api_key_query:
+ type: apiKey
+ name: api_key_query
+ in: query
+ http_basic_test:
+ type: http
+ scheme: basic
+ bearer_test:
+ type: http
+ scheme: bearer
+ bearerFormat: JWT
+ http_signature_test:
+ type: http
+ scheme: signature
+ schemas:
+ FruitType:
+ properties:
+ fruitType:
+ type: string
+ required:
+ - fruitType
+ FruitInlineDisc:
+ oneOf:
+ - type: object
+ required:
+ - seeds
+ - fruitType
+ properties:
+ seeds:
+ type: integer
+ fruitType:
+ type: string
+ - type: object
+ required:
+ - length
+ - fruitType
+ properties:
+ length:
+ type: integer
+ fruitType:
+ type: string
+ discriminator:
+ propertyName: fruitType
+ FruitInlineInlineDisc:
+ oneOf:
+ - type: object
+ required:
+ - seeds
+ properties:
+ seeds:
+ type: integer
+ oneOf:
+ - type: object
+ properties:
+ fruitType:
+ type: string
+ required:
+ - fruitType
+ - type: object
+ required:
+ - length
+ properties:
+ length:
+ type: integer
+ oneOf:
+ - type: object
+ properties:
+ fruitType:
+ type: string
+ required:
+ - fruitType
+ discriminator:
+ propertyName: fruitType
+ FruitReqDisc:
+ oneOf:
+ - $ref: "#/components/schemas/AppleReqDisc"
+ - $ref: "#/components/schemas/BananaReqDisc"
+ discriminator:
+ propertyName: fruitType
+ AppleReqDisc:
+ type: object
+ required:
+ - seeds
+ - fruitType
+ properties:
+ seeds:
+ type: integer
+ fruitType:
+ type: string
+ BananaReqDisc:
+ type: object
+ required:
+ - length
+ - fruitType
+ properties:
+ length:
+ type: integer
+ fruitType:
+ type: string
+ FruitAllOfDisc:
+ oneOf:
+ - $ref: "#/components/schemas/AppleAllOfDisc"
+ - $ref: "#/components/schemas/BananaAllOfDisc"
+ discriminator:
+ propertyName: fruitType
+ AppleAllOfDisc:
+ type: object
+ required:
+ - seeds
+ properties:
+ seeds:
+ type: integer
+ allOf:
+ - $ref: "#/components/schemas/FruitType"
+ BananaAllOfDisc:
+ type: object
+ required:
+ - length
+ properties:
+ length:
+ type: integer
+ allOf:
+ - $ref: "#/components/schemas/FruitType"
+ FruitAnyOfDisc:
+ anyOf:
+ - $ref: "#/components/schemas/AppleAnyOfDisc"
+ - $ref: "#/components/schemas/BananaAnyOfDisc"
+ discriminator:
+ propertyName: fruitType
+ AppleAnyOfDisc:
+ type: object
+ required:
+ - seeds
+ properties:
+ seeds:
+ type: integer
+ anyOf:
+ - $ref: "#/components/schemas/FruitType"
+ BananaAnyOfDisc:
+ type: object
+ required:
+ - length
+ properties:
+ length:
+ type: integer
+ anyOf:
+ - $ref: "#/components/schemas/FruitType"
+ FruitOneOfDisc:
+ oneOf:
+ - $ref: "#/components/schemas/AppleOneOfDisc"
+ - $ref: "#/components/schemas/BananaOneOfDisc"
+ discriminator:
+ propertyName: fruitType
+ AppleOneOfDisc:
+ type: object
+ required:
+ - seeds
+ properties:
+ seeds:
+ type: integer
+ oneOf:
+ - $ref: "#/components/schemas/FruitType"
+ BananaOneOfDisc:
+ type: object
+ required:
+ - length
+ properties:
+ length:
+ type: integer
+ oneOf:
+ - $ref: "#/components/schemas/FruitType"
+ FruitGrandparentDisc:
+ oneOf:
+ - $ref: "#/components/schemas/AppleGrandparentDisc"
+ - $ref: "#/components/schemas/BananaGrandparentDisc"
+ discriminator:
+ propertyName: fruitType
+ Parent:
+ type: object
+ allOf:
+ # the FruitType schema is a grandparent of AppleGrandparentDisc + BananaGrandparentDisc
+ - $ref: "#/components/schemas/FruitType"
+ AppleGrandparentDisc:
+ type: object
+ required:
+ - seeds
+ properties:
+ seeds:
+ type: integer
+ allOf:
+ - $ref: "#/components/schemas/Parent"
+ BananaGrandparentDisc:
+ type: object
+ required:
+ - length
+ properties:
+ length:
+ type: integer
+ allOf:
+ - $ref: "#/components/schemas/Parent"
+ # ComposedDiscMissingNoProperties:
+ # oneOf:
+ # - $ref: "#/components/schemas/DiscMissingNoProperties"
+ # discriminator:
+ # propertyName: fruitType
+ # # Model DiscMissingNoProperties not generated since it's a free-form object
+ # DiscMissingNoProperties:
+ # type: object
+ ComposedDiscMissingFromProperties:
+ oneOf:
+ - $ref: "#/components/schemas/DiscMissingFromProperties"
+ discriminator:
+ propertyName: fruitType
+ DiscMissingFromProperties:
+ type: object
+ properties:
+ length:
+ type: integer
+ ComposedDiscOptionalTypeCorrect:
+ oneOf:
+ - $ref: "#/components/schemas/DiscOptionalTypeCorrect"
+ discriminator:
+ propertyName: fruitType
+ DiscOptionalTypeCorrect:
+ type: object
+ properties:
+ fruitType:
+ type: string
+ ComposedDiscOptionalTypeIncorrect:
+ oneOf:
+ - $ref: "#/components/schemas/DiscOptionalTypeIncorrect"
+ discriminator:
+ propertyName: fruitType
+ DiscOptionalTypeIncorrect:
+ type: object
+ properties:
+ fruitType:
+ type: integer
+ ComposedDiscOptionalTypeInconsistent:
+ oneOf:
+ - $ref: "#/components/schemas/DiscOptionalTypeIncorrect"
+ - $ref: "#/components/schemas/DiscOptionalTypeCorrect"
+ discriminator:
+ propertyName: fruitType
+ ComposedDiscTypeIncorrect:
+ oneOf:
+ - $ref: "#/components/schemas/DiscTypeIncorrect"
+ discriminator:
+ propertyName: fruitType
+ DiscTypeIncorrect:
+ type: object
+ properties:
+ fruitType:
+ type: integer
+ required:
+ - fruitType
+ ComposedDiscTypeInconsistent:
+ oneOf:
+ - $ref: "#/components/schemas/DiscTypeIncorrect"
+ - $ref: "#/components/schemas/FruitType"
+ discriminator:
+ propertyName: fruitType
+ ComposedDiscRequiredInconsistent:
+ oneOf:
+ - $ref: "#/components/schemas/DiscOptionalTypeCorrect"
+ - $ref: "#/components/schemas/FruitType"
+ discriminator:
+ propertyName: fruitType
+
+ fruitVariant1:
+ title: fruit
+ properties:
+ color:
+ type: string
+ oneOf:
+ - $ref: "#/components/schemas/appleVariant1"
+ - $ref: "#/components/schemas/grapesVariant1"
+ # additionalProperties:
+ # type: string
+ # uncomment this when https://github.com/swagger-api/swagger-parser/issues/1252 is resolved
+ appleVariant1:
+ title: apple
+ type: object
+ properties:
+ kind:
+ type: string
+ applesVariant1:
+ title: apples
+ type: object
+ additionalProperties:
+ $ref: "#/components/schemas/appleVariant1"
+ grapeVariant1:
+ title: grape
+ type: object
+ properties:
+ color:
+ type: string
+ grapesVariant1:
+ title: grapes
+ type: array
+ items:
+ $ref: "#/components/schemas/grapeVariant1"
+
+ GigaOneOf:
+ oneOf:
+ - type: string
+ format: uuid
+ - type: string
+ format: date-time
+ - type: integer
+ - type: number
+ - $ref: "#/components/schemas/OneOfPrimitiveChild"
+ - type: integer
+ format: int32
+ OneOfPrimitiveChild:
+ type: object
+ properties:
+ name:
+ type: string
+
+ fruit:
+ title: fruit
+ properties:
+ color:
+ type: string
+ oneOf:
+ - $ref: "#/components/schemas/apple"
+ - $ref: "#/components/schemas/banana"
+ # additionalProperties:
+ # type: string
+ # uncomment this when https://github.com/swagger-api/swagger-parser/issues/1252 is resolved
+ apple:
+ title: apple
+ type: object
+ properties:
+ kind:
+ type: string
+ banana:
+ title: banana
+ type: object
+ properties:
+ count:
+ type: number
+ Addressable:
+ type: object
+ properties:
+ href:
+ type: string
+ description: Hyperlink reference
+ id:
+ type: string
+ description: unique identifier
+ description: Base schema for addressable entities
+ Extensible:
+ type: object
+ properties:
+ "@schemaLocation":
+ type: string
+ description:
+ A URI to a JSON-Schema file that defines additional attributes
+ and relationships
+ "@baseType":
+ type: string
+ description: When sub-classing, this defines the super-class
+ "@type":
+ type: string
+ description: When sub-classing, this defines the sub-class Extensible name
+ required:
+ - "@type"
+ Entity:
+ type: object
+ discriminator:
+ propertyName: "@type"
+ allOf:
+ - "$ref": "#/components/schemas/Addressable"
+ - "$ref": "#/components/schemas/Extensible"
+ EntityRef:
+ type: object
+ discriminator:
+ propertyName: "@type"
+ description: Entity reference schema to be use for all entityRef class.
+ properties:
+ name:
+ type: string
+ description: Name of the related entity.
+ "@referredType":
+ type: string
+ description: The actual type of the target instance when needed for disambiguation.
+ allOf:
+ - $ref: "#/components/schemas/Addressable"
+ - "$ref": "#/components/schemas/Extensible"
+ FooRefOrValue:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/Foo"
+ - $ref: "#/components/schemas/FooRef"
+ discriminator:
+ propertyName: "@type"
+ Foo:
+ type: object
+ properties:
+ fooPropA:
+ type: string
+ fooPropB:
+ type: string
+ allOf:
+ - $ref: "#/components/schemas/Entity"
+ FooRef:
+ type: object
+ properties:
+ foorefPropA:
+ type: string
+ allOf:
+ - $ref: "#/components/schemas/EntityRef"
+ BarRef:
+ type: object
+ allOf:
+ - $ref: "#/components/schemas/EntityRef"
+ Bar_Create:
+ type: object
+ properties:
+ barPropA:
+ type: string
+ fooPropB:
+ type: string
+ foo:
+ $ref: "#/components/schemas/FooRefOrValue"
+ allOf:
+ - $ref: "#/components/schemas/Entity"
+ Bar:
+ type: object
+ required:
+ - id
+ properties:
+ id:
+ type: string
+ barPropA:
+ type: string
+ fooPropB:
+ type: string
+ foo:
+ $ref: "#/components/schemas/FooRefOrValue"
+ allOf:
+ - $ref: "#/components/schemas/Entity"
+ BarRefOrValue:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/Bar"
+ - $ref: "#/components/schemas/BarRef"
+ Pizza:
+ type: object
+ properties:
+ pizzaSize:
+ type: number
+ allOf:
+ - $ref: "#/components/schemas/Entity"
+ Pasta:
+ type: object
+ properties:
+ vendor:
+ type: string
+ allOf:
+ - $ref: "#/components/schemas/Entity"
+ PizzaSpeziale:
+ type: object
+ properties:
+ toppings:
+ type: string
+ allOf:
+ - $ref: "#/components/schemas/Pizza"
+
+ Order:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ petId:
+ type: integer
+ format: int64
+ quantity:
+ type: integer
+ format: int32
+ shipDate:
+ type: string
+ format: date-time
+ status:
+ type: string
+ description: Order Status
+ enum:
+ - placed
+ - approved
+ - delivered
+ complete:
+ type: boolean
+ default: false
+ xml:
+ name: Order
+ Category:
+ type: object
+ required:
+ - name
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ default: default-name
+ xml:
+ name: Category
+ User:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ x-is-unique: true
+ username:
+ type: string
+ firstName:
+ type: string
+ lastName:
+ type: string
+ email:
+ type: string
+ password:
+ type: string
+ phone:
+ type: string
+ userStatus:
+ type: integer
+ format: int32
+ description: User Status
+ xml:
+ name: User
+ Tag:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ xml:
+ name: Tag
+ Pet:
+ type: object
+ required:
+ - name
+ - photoUrls
+ properties:
+ id:
+ type: integer
+ format: int64
+ x-is-unique: true
+ category:
+ $ref: "#/components/schemas/Category"
+ name:
+ type: string
+ example: doggie
+ photoUrls:
+ type: array
+ xml:
+ name: photoUrl
+ wrapped: true
+ items:
+ type: string
+ uniqueItems: true
+ tags:
+ type: array
+ xml:
+ name: tag
+ wrapped: true
+ items:
+ $ref: "#/components/schemas/Tag"
+ status:
+ type: string
+ description: pet status in the store
+ enum:
+ - available
+ - pending
+ - sold
+ xml:
+ name: Pet
+ ApiResponse:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ type:
+ type: string
+ message:
+ type: string
+ Return:
+ description: Model for testing reserved words
+ properties:
+ return:
+ type: integer
+ format: int32
+ xml:
+ name: Return
+ Name:
+ description: Model for testing model name same as property name
+ required:
+ - name
+ properties:
+ name:
+ type: integer
+ format: int32
+ snake_case:
+ readOnly: true
+ type: integer
+ format: int32
+ property:
+ type: string
+ 123Number:
+ type: integer
+ readOnly: true
+ xml:
+ name: Name
+ 200_response:
+ description: Model for testing model name starting with number
+ properties:
+ name:
+ type: integer
+ format: int32
+ class:
+ type: string
+ xml:
+ name: Name
+ ClassModel:
+ description: Model for testing model with "_class" property
+ properties:
+ _class:
+ type: string
+ Dog:
+ allOf:
+ - $ref: "#/components/schemas/Animal"
+ - type: object
+ properties:
+ breed:
+ type: string
+ Cat:
+ allOf:
+ - $ref: "#/components/schemas/Animal"
+ - type: object
+ properties:
+ declawed:
+ type: boolean
+ Animal:
+ type: object
+ discriminator:
+ propertyName: className
+ mapping:
+ DOG: "#/components/schemas/Dog"
+ CAT: "#/components/schemas/Cat"
+ required:
+ - className
+ properties:
+ className:
+ type: string
+ color:
+ type: string
+ default: red
+ AnimalFarm:
+ type: array
+ items:
+ $ref: "#/components/schemas/Animal"
+ format_test:
+ type: object
+ required:
+ - number
+ - byte
+ - date
+ - password
+ properties:
+ integer:
+ type: integer
+ maximum: 100
+ minimum: 10
+ int32:
+ type: integer
+ format: int32
+ maximum: 200
+ minimum: 20
+ int64:
+ type: integer
+ format: int64
+ number:
+ maximum: 543.2
+ minimum: 32.1
+ type: number
+ float:
+ type: number
+ format: float
+ maximum: 987.6
+ minimum: 54.3
+ double:
+ type: number
+ format: double
+ maximum: 123.4
+ minimum: 67.8
+ decimal:
+ type: string
+ format: number
+ string:
+ type: string
+ pattern: "/[a-z]/i"
+ byte:
+ type: string
+ format: byte
+ binary:
+ type: string
+ format: binary
+ date:
+ type: string
+ format: date
+ dateTime:
+ type: string
+ format: date-time
+ uuid:
+ type: string
+ format: uuid
+ example: 72f98069-206d-4f12-9f12-3d1e525a8e84
+ password:
+ type: string
+ format: password
+ maxLength: 64
+ minLength: 10
+ pattern_with_digits:
+ description: A string that is a 10 digit number. Can have leading zeros.
+ type: string
+ pattern: '^\d{10}$'
+ pattern_with_digits_and_delimiter:
+ description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
+ type: string
+ pattern: '/^image_\d{1,3}$/i'
+ EnumClass:
+ type: string
+ default: "-efg"
+ enum:
+ - _abc
+ - "-efg"
+ - (xyz)
+ Enum_Test:
+ type: object
+ required:
+ - enum_string_required
+ properties:
+ enum_string:
+ type: string
+ enum:
+ - UPPER
+ - lower
+ - ""
+ enum_string_required:
+ type: string
+ enum:
+ - UPPER
+ - lower
+ - ""
+ enum_integer:
+ type: integer
+ format: int32
+ enum:
+ - 1
+ - -1
+ enum_number:
+ type: number
+ format: double
+ enum:
+ - 1.1
+ - -1.2
+ outerEnum:
+ $ref: "#/components/schemas/OuterEnum"
+ outerEnumInteger:
+ $ref: "#/components/schemas/OuterEnumInteger"
+ outerEnumDefaultValue:
+ $ref: "#/components/schemas/OuterEnumDefaultValue"
+ outerEnumIntegerDefaultValue:
+ $ref: "#/components/schemas/OuterEnumIntegerDefaultValue"
+ AdditionalPropertiesClass:
+ type: object
+ properties:
+ map_property:
+ type: object
+ additionalProperties:
+ type: string
+ map_of_map_property:
+ type: object
+ additionalProperties:
+ type: object
+ additionalProperties:
+ type: string
+ MixedPropertiesAndAdditionalPropertiesClass:
+ type: object
+ properties:
+ uuid:
+ type: string
+ format: uuid
+ dateTime:
+ type: string
+ format: date-time
+ map:
+ type: object
+ additionalProperties:
+ $ref: "#/components/schemas/Animal"
+ List:
+ type: object
+ properties:
+ 123-list:
+ type: string
+ Client:
+ type: object
+ properties:
+ client:
+ type: string
+ ReadOnlyFirst:
+ type: object
+ properties:
+ bar:
+ type: string
+ readOnly: true
+ baz:
+ type: string
+ hasOnlyReadOnly:
+ type: object
+ properties:
+ bar:
+ type: string
+ readOnly: true
+ foo:
+ type: string
+ readOnly: true
+ Capitalization:
+ type: object
+ properties:
+ smallCamel:
+ type: string
+ CapitalCamel:
+ type: string
+ small_Snake:
+ type: string
+ Capital_Snake:
+ type: string
+ SCA_ETH_Flow_Points:
+ type: string
+ ATT_NAME:
+ description: |
+ Name of the pet
+ type: string
+ MapTest:
+ type: object
+ properties:
+ map_map_of_string:
+ type: object
+ additionalProperties:
+ type: object
+ additionalProperties:
+ type: string
+ map_of_enum_string:
+ type: object
+ additionalProperties:
+ type: string
+ enum:
+ - UPPER
+ - lower
+ direct_map:
+ type: object
+ additionalProperties:
+ type: boolean
+ indirect_map:
+ $ref: "#/components/schemas/StringBooleanMap"
+ ArrayTest:
+ type: object
+ properties:
+ array_of_string:
+ type: array
+ items:
+ type: string
+ minItems: 0
+ maxItems: 3
+ array_array_of_integer:
+ type: array
+ items:
+ type: array
+ items:
+ type: integer
+ format: int64
+ array_array_of_model:
+ type: array
+ items:
+ type: array
+ items:
+ $ref: "#/components/schemas/ReadOnlyFirst"
+ NumberOnly:
+ type: object
+ properties:
+ JustNumber:
+ type: number
+ ArrayOfNumberOnly:
+ type: object
+ properties:
+ ArrayNumber:
+ type: array
+ items:
+ type: number
+ ArrayOfArrayOfNumberOnly:
+ type: object
+ properties:
+ ArrayArrayNumber:
+ type: array
+ items:
+ type: array
+ items:
+ type: number
+ EnumArrays:
+ type: object
+ properties:
+ just_symbol:
+ type: string
+ enum:
+ - ">="
+ - $
+ array_enum:
+ type: array
+ items:
+ type: string
+ enum:
+ - fish
+ - crab
+ OuterEnum:
+ nullable: true
+ type: string
+ enum:
+ - placed
+ - approved
+ - delivered
+ OuterEnumInteger:
+ type: integer
+ enum:
+ - 0
+ - 1
+ - 2
+ example: 2
+ OuterEnumDefaultValue:
+ type: string
+ enum:
+ - placed
+ - approved
+ - delivered
+ default: placed
+ OuterEnumIntegerDefaultValue:
+ type: integer
+ enum:
+ - 0
+ - 1
+ - 2
+ default: 0
+ OuterComposite:
+ type: object
+ properties:
+ my_number:
+ $ref: "#/components/schemas/OuterNumber"
+ my_string:
+ $ref: "#/components/schemas/OuterString"
+ my_boolean:
+ $ref: "#/components/schemas/OuterBoolean"
+ OuterNumber:
+ type: number
+ OuterString:
+ type: string
+ OuterBoolean:
+ type: boolean
+ x-codegen-body-parameter-name: boolean_post_body
+ StringBooleanMap:
+ additionalProperties:
+ type: boolean
+ FileSchemaTestClass:
+ type: object
+ properties:
+ file:
+ $ref: "#/components/schemas/File"
+ files:
+ type: array
+ items:
+ $ref: "#/components/schemas/File"
+ File:
+ type: object
+ description: Must be named `File` for test.
+ properties:
+ sourceURI:
+ description: Test capitalization
+ type: string
+ _special_model.name_:
+ properties:
+ "$special[property.name]":
+ type: integer
+ format: int64
+ xml:
+ name: "$special[model.name]"
+ HealthCheckResult:
+ type: object
+ properties:
+ NullableMessage:
+ nullable: true
+ type: string
+ description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+ NullableClass:
+ type: object
+ properties:
+ integer_prop:
+ type: integer
+ nullable: true
+ number_prop:
+ type: number
+ nullable: true
+ boolean_prop:
+ type: boolean
+ nullable: true
+ string_prop:
+ type: string
+ nullable: true
+ date_prop:
+ type: string
+ format: date
+ nullable: true
+ datetime_prop:
+ type: string
+ format: date-time
+ nullable: true
+ array_nullable_prop:
+ type: array
+ nullable: true
+ items:
+ type: object
+ array_and_items_nullable_prop:
+ type: array
+ nullable: true
+ items:
+ type: object
+ nullable: true
+ array_items_nullable:
+ type: array
+ items:
+ type: object
+ nullable: true
+ object_nullable_prop:
+ type: object
+ nullable: true
+ additionalProperties:
+ type: object
+ object_and_items_nullable_prop:
+ type: object
+ nullable: true
+ additionalProperties:
+ type: object
+ nullable: true
+ object_items_nullable:
+ type: object
+ additionalProperties:
+ type: object
+ nullable: true
+ additionalProperties:
+ type: object
+ nullable: true
+ OuterObjectWithEnumProperty:
+ type: object
+ example:
+ value: 2
+ required:
+ - value
+ properties:
+ value:
+ $ref: "#/components/schemas/OuterEnumInteger"
+ DeprecatedObject:
+ type: object
+ deprecated: true
+ properties:
+ name:
+ type: string
+ ObjectWithDeprecatedFields:
+ type: object
+ properties:
+ uuid:
+ type: string
+ id:
+ type: number
+ deprecated: true
+ deprecatedRef:
+ $ref: "#/components/schemas/DeprecatedObject"
+ bars:
+ type: array
+ deprecated: true
+ items:
+ $ref: "#/components/schemas/Bar"
+ AllOfWithSingleRef:
+ type: object
+ properties:
+ username:
+ type: string
+ SingleRefType:
+ allOf:
+ - $ref: "#/components/schemas/SingleRefType"
+ SingleRefType:
+ type: string
+ title: SingleRefType
+ enum:
+ - admin
+ - user
+ responses:
+ "204":
+ description: Deleted
+ content: {}
+ 201Foo:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/FooRefOrValue"
+ 200FooArray:
+ description: Success
+ content:
+ application/json;charset=utf-8:
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/FooRefOrValue"
diff --git a/pom.xml b/pom.xml
index 2bbdefe67e90..3a519a34d28b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1135,6 +1135,239 @@
samples/server/petstore/java-undertow
+
+ samples
+
+
+ env
+ samples
+
+
+
+
+
+
+
+
+
+
+
+
+ samples/client/petstore/rust
+ samples/client/petstore/rust/hyper/petstore
+ samples/client/petstore/rust/reqwest/petstore
+ samples/client/petstore/rust/reqwest/petstore-async
+ samples/client/petstore/rust/reqwest/petstore-async-middleware
+
+
+
+
+
+ samples.circleci
+
+
+ env
+ samples.circleci
+
+
+
+ samples/client/petstore/ruby
+ samples/client/petstore/ruby-faraday
+ samples/client/petstore/ruby-autoload
+
+
+
+ samples.circleci.spring
+
+
+ env
+ samples.circleci.spring
+
+
+
+
+ samples/client/petstore/spring-cloud
+
+
+
+
+ samples.circleci.node3
+
+
+ env
+ samples.circleci.node3
+
+
+
+
+ samples/openapi3/client/petstore/python
+ samples/openapi3/client/petstore/python-aiohttp
+
+
+ samples/client/others/typescript-angular
+ samples/client/petstore/typescript-angular-v12-provided-in-root
+ samples/client/petstore/typescript-angular-v13-provided-in-root
+ samples/client/petstore/typescript-angular-v14-provided-in-root
+ samples/client/petstore/typescript-angular-v15-provided-in-root
+ samples/client/petstore/typescript-angular-v16-provided-in-root
+ samples/openapi3/client/petstore/typescript/builds/default
+ samples/openapi3/client/petstore/typescript/tests/default
+ samples/openapi3/client/petstore/typescript/builds/jquery
+ samples/openapi3/client/petstore/typescript/tests/jquery
+ samples/openapi3/client/petstore/typescript/builds/object_params
+ samples/openapi3/client/petstore/typescript/tests/object_params
+ samples/openapi3/client/petstore/typescript/builds/inversify
+
+ samples/openapi3/client/petstore/typescript/builds/browser
+ samples/openapi3/client/petstore/typescript/tests/browser
+ samples/client/petstore/typescript-fetch/builds/default
+ samples/client/petstore/typescript-fetch/builds/es6-target
+ samples/client/petstore/typescript-fetch/builds/with-npm-version
+ samples/client/petstore/typescript-fetch/tests/default
+ samples/client/petstore/typescript-node/npm
+ samples/client/petstore/typescript-rxjs/builds/with-npm-version
+ samples/client/petstore/typescript-axios/builds/with-npm-version
+ samples/client/petstore/typescript-axios/tests/default
+ samples/client/petstore/javascript-flowtyped
+ samples/client/petstore/javascript-es6
+ samples/client/petstore/javascript-promise-es6
+
+
+
+
+ samples.circleci.node4
+
+
+ env
+ samples.circleci.node4
+
+
+
+
+
+
+
+ samples.circleci.others
+
+
+ env
+ samples.circleci.others
+
+
+
+
+
+ samples/client/petstore/scala-akka
+ samples/client/petstore/scala-sttp
+ samples/client/petstore/scala-sttp4
+ samples/client/petstore/clojure
+ samples/client/petstore/java/jersey2-java8
+ samples/openapi3/client/petstore/java/jersey2-java8
+ samples/client/petstore/java/jersey3
+ samples/client/others/java/okhttp-gson-streaming
+ samples/client/petstore/java/okhttp-gson
+ samples/client/petstore/java-micronaut-client
+ samples/client/petstore/java/apache-httpclient
+
+
+
+
+ samples.misc
+
+
+ env
+ samples.misc
+
+
+
+
+
+
+
+
+ samples/client/petstore/go
+ samples/openapi3/client/petstore/go
+
+
+
+
+ samples.dart
+
+
+ env
+ samples.dart
+
+
+
+ samples/openapi3/client/petstore/dart2/petstore_client_lib
+ samples/openapi3/client/petstore/dart-dio/oneof
+ samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance
+ samples/openapi3/client/petstore/dart-dio/oneof_primitive
+ samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake
+ samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable
+ samples/client/echo_api/dart/dio/built_value
+ samples/client/echo_api/dart/dio/json_serializable
+
+
+
+ samples.ios
+
+
+ env
+ samples.ios
+
+
+
+
+ samples/client/petstore/swift5/alamofireLibrary
+ samples/client/petstore/swift5/combineLibrary
+ samples/client/petstore/swift5/default
+ samples/client/petstore/swift5/deprecated
+ samples/client/petstore/swift5/frozenEnums
+ samples/client/petstore/swift5/nonPublicApi
+ samples/client/petstore/swift5/objcCompatible
+ samples/client/petstore/swift5/promisekitLibrary
+ samples/client/petstore/swift5/readonlyProperties
+ samples/client/petstore/swift5/resultLibrary
+ samples/client/petstore/swift5/rxswiftLibrary
+ samples/client/petstore/swift5/urlsessionLibrary
+
+
+
+
+
+
openapi-generator
diff --git a/samples/client/echo_api/dart/dio/built_value/.gitignore b/samples/client/echo_api/dart/dio/built_value/.gitignore
new file mode 100644
index 000000000000..4298cdcbd1a2
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/.gitignore
@@ -0,0 +1,41 @@
+# See https://dart.dev/guides/libraries/private-files
+
+# Files and directories created by pub
+.dart_tool/
+.buildlog
+.packages
+.project
+.pub/
+build/
+**/packages/
+
+# Files created by dart2js
+# (Most Dart developers will use pub build to compile Dart, use/modify these
+# rules if you intend to use dart2js directly
+# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
+# differentiate from explicit Javascript files)
+*.dart.js
+*.part.js
+*.js.deps
+*.js.map
+*.info.json
+
+# Directory created by dartdoc
+doc/api/
+
+# Don't commit pubspec lock file
+# (Library packages only! Remove pattern if developing an application package)
+pubspec.lock
+
+# Don’t commit files and directories created by other development environments.
+# For example, if your development environment creates any of the following files,
+# consider putting them in a global ignore file:
+
+# IntelliJ
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# Mac
+.DS_Store
diff --git a/samples/client/echo_api/dart/dio/built_value/.openapi-generator-ignore b/samples/client/echo_api/dart/dio/built_value/.openapi-generator-ignore
new file mode 100644
index 000000000000..7484ee590a38
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES b/samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES
new file mode 100644
index 000000000000..18008f8208c3
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES
@@ -0,0 +1,347 @@
+.gitignore
+README.md
+analysis_options.yaml
+doc/AdditionalPropertiesClass.md
+doc/Addressable.md
+doc/AllOfWithSingleRef.md
+doc/Animal.md
+doc/AnotherFakeApi.md
+doc/ApiResponse.md
+doc/Apple.md
+doc/AppleAllOfDisc.md
+doc/AppleGrandparentDisc.md
+doc/AppleOneOfDisc.md
+doc/AppleReqDisc.md
+doc/AppleVariant1.md
+doc/ArrayOfArrayOfNumberOnly.md
+doc/ArrayOfNumberOnly.md
+doc/ArrayTest.md
+doc/Banana.md
+doc/BananaAllOfDisc.md
+doc/BananaGrandparentDisc.md
+doc/BananaOneOfDisc.md
+doc/BananaReqDisc.md
+doc/Bar.md
+doc/BarApi.md
+doc/BarCreate.md
+doc/BarRef.md
+doc/BarRefOrValue.md
+doc/Capitalization.md
+doc/Cat.md
+doc/Category.md
+doc/ClassModel.md
+doc/ComposedDiscMissingFromProperties.md
+doc/ComposedDiscOptionalTypeCorrect.md
+doc/ComposedDiscOptionalTypeInconsistent.md
+doc/ComposedDiscOptionalTypeIncorrect.md
+doc/ComposedDiscRequiredInconsistent.md
+doc/ComposedDiscTypeInconsistent.md
+doc/ComposedDiscTypeIncorrect.md
+doc/DefaultApi.md
+doc/DeprecatedObject.md
+doc/DiscMissingFromProperties.md
+doc/DiscOptionalTypeCorrect.md
+doc/DiscOptionalTypeIncorrect.md
+doc/DiscTypeIncorrect.md
+doc/Dog.md
+doc/Entity.md
+doc/EntityRef.md
+doc/EnumArrays.md
+doc/EnumTest.md
+doc/Extensible.md
+doc/FakeApi.md
+doc/FakeClassnameTags123Api.md
+doc/FileSchemaTestClass.md
+doc/Foo.md
+doc/FooApi.md
+doc/FooBasicGetDefaultResponse.md
+doc/FooRef.md
+doc/FooRefOrValue.md
+doc/FormatTest.md
+doc/Fruit.md
+doc/FruitAllOfDisc.md
+doc/FruitAnyOfDisc.md
+doc/FruitGrandparentDisc.md
+doc/FruitInlineDisc.md
+doc/FruitInlineDiscOneOf.md
+doc/FruitInlineDiscOneOf1.md
+doc/FruitInlineInlineDisc.md
+doc/FruitInlineInlineDiscOneOf.md
+doc/FruitInlineInlineDiscOneOf1.md
+doc/FruitInlineInlineDiscOneOfOneOf.md
+doc/FruitOneOfDisc.md
+doc/FruitReqDisc.md
+doc/FruitType.md
+doc/FruitVariant1.md
+doc/GigaOneOf.md
+doc/GrapeVariant1.md
+doc/HasOnlyReadOnly.md
+doc/HealthCheckResult.md
+doc/MapTest.md
+doc/MixedPropertiesAndAdditionalPropertiesClass.md
+doc/Model200Response.md
+doc/ModelClient.md
+doc/ModelEnumClass.md
+doc/ModelFile.md
+doc/ModelList.md
+doc/ModelReturn.md
+doc/Name.md
+doc/NullableClass.md
+doc/NumberOnly.md
+doc/ObjectWithDeprecatedFields.md
+doc/OneOfPrimitiveChild.md
+doc/Order.md
+doc/OuterComposite.md
+doc/OuterEnum.md
+doc/OuterEnumDefaultValue.md
+doc/OuterEnumInteger.md
+doc/OuterEnumIntegerDefaultValue.md
+doc/OuterObjectWithEnumProperty.md
+doc/Parent.md
+doc/Pasta.md
+doc/Pet.md
+doc/PetApi.md
+doc/Pizza.md
+doc/PizzaSpeziale.md
+doc/ReadOnlyFirst.md
+doc/SingleRefType.md
+doc/SpecialModelName.md
+doc/StoreApi.md
+doc/Tag.md
+doc/User.md
+doc/UserApi.md
+lib/apis.dart
+lib/models.dart
+lib/openapi.dart
+lib/src/api/another_fake_api.dart
+lib/src/api/bar_api.dart
+lib/src/api/default_api.dart
+lib/src/api/fake_api.dart
+lib/src/api/fake_classname_tags123_api.dart
+lib/src/api/foo_api.dart
+lib/src/api/pet_api.dart
+lib/src/api/store_api.dart
+lib/src/api/user_api.dart
+lib/src/api_client.dart
+lib/src/api_util.dart
+lib/src/auth/_exports.dart
+lib/src/auth/api_key_auth.dart
+lib/src/auth/auth.dart
+lib/src/auth/basic_auth.dart
+lib/src/auth/bearer_auth.dart
+lib/src/auth/oauth.dart
+lib/src/date_serializer.dart
+lib/src/model/additional_properties_class.dart
+lib/src/model/addressable.dart
+lib/src/model/all_of_with_single_ref.dart
+lib/src/model/animal.dart
+lib/src/model/api_response.dart
+lib/src/model/apple.dart
+lib/src/model/apple_all_of_disc.dart
+lib/src/model/apple_grandparent_disc.dart
+lib/src/model/apple_one_of_disc.dart
+lib/src/model/apple_req_disc.dart
+lib/src/model/apple_variant1.dart
+lib/src/model/array_of_array_of_number_only.dart
+lib/src/model/array_of_number_only.dart
+lib/src/model/array_test.dart
+lib/src/model/banana.dart
+lib/src/model/banana_all_of_disc.dart
+lib/src/model/banana_grandparent_disc.dart
+lib/src/model/banana_one_of_disc.dart
+lib/src/model/banana_req_disc.dart
+lib/src/model/bar.dart
+lib/src/model/bar_create.dart
+lib/src/model/bar_ref.dart
+lib/src/model/bar_ref_or_value.dart
+lib/src/model/capitalization.dart
+lib/src/model/cat.dart
+lib/src/model/category.dart
+lib/src/model/class_model.dart
+lib/src/model/composed_disc_missing_from_properties.dart
+lib/src/model/composed_disc_optional_type_correct.dart
+lib/src/model/composed_disc_optional_type_inconsistent.dart
+lib/src/model/composed_disc_optional_type_incorrect.dart
+lib/src/model/composed_disc_required_inconsistent.dart
+lib/src/model/composed_disc_type_inconsistent.dart
+lib/src/model/composed_disc_type_incorrect.dart
+lib/src/model/date.dart
+lib/src/model/deprecated_object.dart
+lib/src/model/disc_missing_from_properties.dart
+lib/src/model/disc_optional_type_correct.dart
+lib/src/model/disc_optional_type_incorrect.dart
+lib/src/model/disc_type_incorrect.dart
+lib/src/model/dog.dart
+lib/src/model/entity.dart
+lib/src/model/entity_ref.dart
+lib/src/model/enum_arrays.dart
+lib/src/model/enum_test.dart
+lib/src/model/extensible.dart
+lib/src/model/file_schema_test_class.dart
+lib/src/model/foo.dart
+lib/src/model/foo_basic_get_default_response.dart
+lib/src/model/foo_ref.dart
+lib/src/model/foo_ref_or_value.dart
+lib/src/model/format_test.dart
+lib/src/model/fruit.dart
+lib/src/model/fruit_all_of_disc.dart
+lib/src/model/fruit_any_of_disc.dart
+lib/src/model/fruit_grandparent_disc.dart
+lib/src/model/fruit_inline_disc.dart
+lib/src/model/fruit_inline_disc_one_of.dart
+lib/src/model/fruit_inline_disc_one_of1.dart
+lib/src/model/fruit_inline_inline_disc.dart
+lib/src/model/fruit_inline_inline_disc_one_of.dart
+lib/src/model/fruit_inline_inline_disc_one_of1.dart
+lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart
+lib/src/model/fruit_one_of_disc.dart
+lib/src/model/fruit_req_disc.dart
+lib/src/model/fruit_type.dart
+lib/src/model/fruit_variant1.dart
+lib/src/model/giga_one_of.dart
+lib/src/model/grape_variant1.dart
+lib/src/model/has_only_read_only.dart
+lib/src/model/health_check_result.dart
+lib/src/model/map_test.dart
+lib/src/model/mixed_properties_and_additional_properties_class.dart
+lib/src/model/model200_response.dart
+lib/src/model/model_client.dart
+lib/src/model/model_enum_class.dart
+lib/src/model/model_file.dart
+lib/src/model/model_list.dart
+lib/src/model/model_return.dart
+lib/src/model/name.dart
+lib/src/model/nullable_class.dart
+lib/src/model/number_only.dart
+lib/src/model/object_with_deprecated_fields.dart
+lib/src/model/one_of_primitive_child.dart
+lib/src/model/order.dart
+lib/src/model/outer_composite.dart
+lib/src/model/outer_enum.dart
+lib/src/model/outer_enum_default_value.dart
+lib/src/model/outer_enum_integer.dart
+lib/src/model/outer_enum_integer_default_value.dart
+lib/src/model/outer_object_with_enum_property.dart
+lib/src/model/parent.dart
+lib/src/model/pasta.dart
+lib/src/model/pet.dart
+lib/src/model/pizza.dart
+lib/src/model/pizza_speziale.dart
+lib/src/model/read_only_first.dart
+lib/src/model/single_ref_type.dart
+lib/src/model/special_model_name.dart
+lib/src/model/tag.dart
+lib/src/model/user.dart
+lib/src/repository_base.dart
+lib/src/repository_impl.dart
+lib/src/serializers.dart
+pubspec.yaml
+test/additional_properties_class_test.dart
+test/addressable_test.dart
+test/all_of_with_single_ref_test.dart
+test/animal_test.dart
+test/another_fake_api_test.dart
+test/api_response_test.dart
+test/apple_all_of_disc_test.dart
+test/apple_grandparent_disc_test.dart
+test/apple_one_of_disc_test.dart
+test/apple_req_disc_test.dart
+test/apple_test.dart
+test/apple_variant1_test.dart
+test/array_of_array_of_number_only_test.dart
+test/array_of_number_only_test.dart
+test/array_test_test.dart
+test/banana_all_of_disc_test.dart
+test/banana_grandparent_disc_test.dart
+test/banana_one_of_disc_test.dart
+test/banana_req_disc_test.dart
+test/banana_test.dart
+test/bar_api_test.dart
+test/bar_create_test.dart
+test/bar_ref_or_value_test.dart
+test/bar_ref_test.dart
+test/bar_test.dart
+test/capitalization_test.dart
+test/cat_test.dart
+test/category_test.dart
+test/class_model_test.dart
+test/composed_disc_missing_from_properties_test.dart
+test/composed_disc_optional_type_correct_test.dart
+test/composed_disc_optional_type_inconsistent_test.dart
+test/composed_disc_optional_type_incorrect_test.dart
+test/composed_disc_required_inconsistent_test.dart
+test/composed_disc_type_inconsistent_test.dart
+test/composed_disc_type_incorrect_test.dart
+test/default_api_test.dart
+test/deprecated_object_test.dart
+test/disc_missing_from_properties_test.dart
+test/disc_optional_type_correct_test.dart
+test/disc_optional_type_incorrect_test.dart
+test/disc_type_incorrect_test.dart
+test/dog_test.dart
+test/entity_ref_test.dart
+test/entity_test.dart
+test/enum_arrays_test.dart
+test/enum_test_test.dart
+test/extensible_test.dart
+test/fake_api_test.dart
+test/fake_classname_tags123_api_test.dart
+test/file_schema_test_class_test.dart
+test/foo_api_test.dart
+test/foo_basic_get_default_response_test.dart
+test/foo_ref_or_value_test.dart
+test/foo_ref_test.dart
+test/foo_test.dart
+test/format_test_test.dart
+test/fruit_all_of_disc_test.dart
+test/fruit_any_of_disc_test.dart
+test/fruit_grandparent_disc_test.dart
+test/fruit_inline_disc_one_of1_test.dart
+test/fruit_inline_disc_one_of_test.dart
+test/fruit_inline_disc_test.dart
+test/fruit_inline_inline_disc_one_of1_test.dart
+test/fruit_inline_inline_disc_one_of_one_of_test.dart
+test/fruit_inline_inline_disc_one_of_test.dart
+test/fruit_inline_inline_disc_test.dart
+test/fruit_one_of_disc_test.dart
+test/fruit_req_disc_test.dart
+test/fruit_test.dart
+test/fruit_type_test.dart
+test/fruit_variant1_test.dart
+test/giga_one_of_test.dart
+test/grape_variant1_test.dart
+test/has_only_read_only_test.dart
+test/health_check_result_test.dart
+test/map_test_test.dart
+test/mixed_properties_and_additional_properties_class_test.dart
+test/model200_response_test.dart
+test/model_client_test.dart
+test/model_enum_class_test.dart
+test/model_file_test.dart
+test/model_list_test.dart
+test/model_return_test.dart
+test/name_test.dart
+test/nullable_class_test.dart
+test/number_only_test.dart
+test/object_with_deprecated_fields_test.dart
+test/one_of_primitive_child_test.dart
+test/order_test.dart
+test/outer_composite_test.dart
+test/outer_enum_default_value_test.dart
+test/outer_enum_integer_default_value_test.dart
+test/outer_enum_integer_test.dart
+test/outer_enum_test.dart
+test/outer_object_with_enum_property_test.dart
+test/parent_test.dart
+test/pasta_test.dart
+test/pet_api_test.dart
+test/pet_test.dart
+test/pizza_speziale_test.dart
+test/pizza_test.dart
+test/read_only_first_test.dart
+test/single_ref_type_test.dart
+test/special_model_name_test.dart
+test/store_api_test.dart
+test/tag_test.dart
+test/user_api_test.dart
+test/user_test.dart
diff --git a/samples/client/echo_api/dart/dio/built_value/.openapi-generator/VERSION b/samples/client/echo_api/dart/dio/built_value/.openapi-generator/VERSION
new file mode 100644
index 000000000000..757e67400401
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.0.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/echo_api/dart/dio/built_value/README.md b/samples/client/echo_api/dart/dio/built_value/README.md
new file mode 100644
index 000000000000..fe2ee6a43a13
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/README.md
@@ -0,0 +1,263 @@
+# openapi (EXPERIMENTAL)
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- Build package: org.openapitools.codegen.languages.DartNextClientCodegen
+
+## Requirements
+
+* Dart 2.15.0+ or Flutter 2.8.0+
+* Dio 5.0.0+ (https://pub.dev/packages/dio)
+
+## Installation & Usage
+
+### pub.dev
+To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml
+```yaml
+dependencies:
+ openapi: 1.0.0
+```
+
+### Github
+If this Dart package is published to Github, please include the following in pubspec.yaml
+```yaml
+dependencies:
+ openapi:
+ git:
+ url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
+ #ref: main
+```
+
+### Local development
+To use the package from your local drive, please include the following in pubspec.yaml
+```yaml
+dependencies:
+ openapi:
+ path: /path/to/openapi
+```
+
+## Getting Started
+
+Please follow the [installation procedure](#installation--usage) and then run the following:
+
+```dart
+import 'package:openapi/openapi.dart';
+
+
+final api = Openapi().getAnotherFakeApi();
+final ModelClient modelClient = ; // ModelClient | client model
+
+try {
+ final response = await api.call123testSpecialTags(modelClient);
+ print(response);
+} catch on DioException (e) {
+ print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n");
+}
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
+[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar
+[*DefaultApi*](doc/DefaultApi.md) | [**fooBasicGet**](doc/DefaultApi.md#foobasicget) | **GET** /foo-basic |
+[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /oneof-primitive |
+[*DefaultApi*](doc/DefaultApi.md) | [**oneofGet**](doc/DefaultApi.md#oneofget) | **GET** /oneof |
+[*DefaultApi*](doc/DefaultApi.md) | [**test**](doc/DefaultApi.md#test) | **PUT** /variant1 |
+[*DefaultApi*](doc/DefaultApi.md) | [**variant1Get**](doc/DefaultApi.md#variant1get) | **GET** /variant1 |
+[*DefaultApi*](doc/DefaultApi.md) | [**variant2Get**](doc/DefaultApi.md#variant2get) | **GET** /variant2 |
+[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
+[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
+[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
+[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
+[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
+[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
+[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
+[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
+[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
+[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
+[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
+[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
+[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
+[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters |
+[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
+[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo
+[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos
+[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
+[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
+[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
+[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
+[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
+[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
+[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
+[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
+[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
+[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
+[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user
+[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
+[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
+[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
+[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
+[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
+[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
+[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
+
+
+## Documentation For Models
+
+ - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md)
+ - [Addressable](doc/Addressable.md)
+ - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md)
+ - [Animal](doc/Animal.md)
+ - [ApiResponse](doc/ApiResponse.md)
+ - [Apple](doc/Apple.md)
+ - [AppleAllOfDisc](doc/AppleAllOfDisc.md)
+ - [AppleGrandparentDisc](doc/AppleGrandparentDisc.md)
+ - [AppleOneOfDisc](doc/AppleOneOfDisc.md)
+ - [AppleReqDisc](doc/AppleReqDisc.md)
+ - [AppleVariant1](doc/AppleVariant1.md)
+ - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md)
+ - [ArrayTest](doc/ArrayTest.md)
+ - [Banana](doc/Banana.md)
+ - [BananaAllOfDisc](doc/BananaAllOfDisc.md)
+ - [BananaGrandparentDisc](doc/BananaGrandparentDisc.md)
+ - [BananaOneOfDisc](doc/BananaOneOfDisc.md)
+ - [BananaReqDisc](doc/BananaReqDisc.md)
+ - [Bar](doc/Bar.md)
+ - [BarCreate](doc/BarCreate.md)
+ - [BarRef](doc/BarRef.md)
+ - [BarRefOrValue](doc/BarRefOrValue.md)
+ - [Capitalization](doc/Capitalization.md)
+ - [Cat](doc/Cat.md)
+ - [Category](doc/Category.md)
+ - [ClassModel](doc/ClassModel.md)
+ - [ComposedDiscMissingFromProperties](doc/ComposedDiscMissingFromProperties.md)
+ - [ComposedDiscOptionalTypeCorrect](doc/ComposedDiscOptionalTypeCorrect.md)
+ - [ComposedDiscOptionalTypeInconsistent](doc/ComposedDiscOptionalTypeInconsistent.md)
+ - [ComposedDiscOptionalTypeIncorrect](doc/ComposedDiscOptionalTypeIncorrect.md)
+ - [ComposedDiscRequiredInconsistent](doc/ComposedDiscRequiredInconsistent.md)
+ - [ComposedDiscTypeInconsistent](doc/ComposedDiscTypeInconsistent.md)
+ - [ComposedDiscTypeIncorrect](doc/ComposedDiscTypeIncorrect.md)
+ - [DeprecatedObject](doc/DeprecatedObject.md)
+ - [DiscMissingFromProperties](doc/DiscMissingFromProperties.md)
+ - [DiscOptionalTypeCorrect](doc/DiscOptionalTypeCorrect.md)
+ - [DiscOptionalTypeIncorrect](doc/DiscOptionalTypeIncorrect.md)
+ - [DiscTypeIncorrect](doc/DiscTypeIncorrect.md)
+ - [Dog](doc/Dog.md)
+ - [Entity](doc/Entity.md)
+ - [EntityRef](doc/EntityRef.md)
+ - [EnumArrays](doc/EnumArrays.md)
+ - [EnumTest](doc/EnumTest.md)
+ - [Extensible](doc/Extensible.md)
+ - [FileSchemaTestClass](doc/FileSchemaTestClass.md)
+ - [Foo](doc/Foo.md)
+ - [FooBasicGetDefaultResponse](doc/FooBasicGetDefaultResponse.md)
+ - [FooRef](doc/FooRef.md)
+ - [FooRefOrValue](doc/FooRefOrValue.md)
+ - [FormatTest](doc/FormatTest.md)
+ - [Fruit](doc/Fruit.md)
+ - [FruitAllOfDisc](doc/FruitAllOfDisc.md)
+ - [FruitAnyOfDisc](doc/FruitAnyOfDisc.md)
+ - [FruitGrandparentDisc](doc/FruitGrandparentDisc.md)
+ - [FruitInlineDisc](doc/FruitInlineDisc.md)
+ - [FruitInlineDiscOneOf](doc/FruitInlineDiscOneOf.md)
+ - [FruitInlineDiscOneOf1](doc/FruitInlineDiscOneOf1.md)
+ - [FruitInlineInlineDisc](doc/FruitInlineInlineDisc.md)
+ - [FruitInlineInlineDiscOneOf](doc/FruitInlineInlineDiscOneOf.md)
+ - [FruitInlineInlineDiscOneOf1](doc/FruitInlineInlineDiscOneOf1.md)
+ - [FruitInlineInlineDiscOneOfOneOf](doc/FruitInlineInlineDiscOneOfOneOf.md)
+ - [FruitOneOfDisc](doc/FruitOneOfDisc.md)
+ - [FruitReqDisc](doc/FruitReqDisc.md)
+ - [FruitType](doc/FruitType.md)
+ - [FruitVariant1](doc/FruitVariant1.md)
+ - [GigaOneOf](doc/GigaOneOf.md)
+ - [GrapeVariant1](doc/GrapeVariant1.md)
+ - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md)
+ - [HealthCheckResult](doc/HealthCheckResult.md)
+ - [MapTest](doc/MapTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Model200Response](doc/Model200Response.md)
+ - [ModelClient](doc/ModelClient.md)
+ - [ModelEnumClass](doc/ModelEnumClass.md)
+ - [ModelFile](doc/ModelFile.md)
+ - [ModelList](doc/ModelList.md)
+ - [ModelReturn](doc/ModelReturn.md)
+ - [Name](doc/Name.md)
+ - [NullableClass](doc/NullableClass.md)
+ - [NumberOnly](doc/NumberOnly.md)
+ - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md)
+ - [OneOfPrimitiveChild](doc/OneOfPrimitiveChild.md)
+ - [Order](doc/Order.md)
+ - [OuterComposite](doc/OuterComposite.md)
+ - [OuterEnum](doc/OuterEnum.md)
+ - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md)
+ - [OuterEnumInteger](doc/OuterEnumInteger.md)
+ - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md)
+ - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md)
+ - [Parent](doc/Parent.md)
+ - [Pasta](doc/Pasta.md)
+ - [Pet](doc/Pet.md)
+ - [Pizza](doc/Pizza.md)
+ - [PizzaSpeziale](doc/PizzaSpeziale.md)
+ - [ReadOnlyFirst](doc/ReadOnlyFirst.md)
+ - [SingleRefType](doc/SingleRefType.md)
+ - [SpecialModelName](doc/SpecialModelName.md)
+ - [Tag](doc/Tag.md)
+ - [User](doc/User.md)
+
+
+## Documentation For Authorization
+
+
+Authentication schemes defined for the API:
+### petstore_auth
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
+- **Scopes**:
+ - **write:pets**: modify pets in your account
+ - **read:pets**: read your pets
+
+### api_key
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+### api_key_query
+
+- **Type**: API key
+- **API key parameter name**: api_key_query
+- **Location**: URL query string
+
+### http_basic_test
+
+- **Type**: HTTP basic authentication
+
+### bearer_test
+
+- **Type**: HTTP Bearer Token authentication (JWT)
+
+### http_signature_test
+
+- **Type**: HTTP signature authentication
+
+
+## Author
+
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/analysis_options.yaml b/samples/client/echo_api/dart/dio/built_value/analysis_options.yaml
new file mode 100644
index 000000000000..c84e864f76be
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/analysis_options.yaml
@@ -0,0 +1,11 @@
+analyzer:
+ language:
+ strict-inference: true
+ strict-raw-types: true
+ strict-casts: true
+ exclude:
+ errors:
+ deprecated_member_use_from_same_package: ignore
+ unused_import: ignore
+ unused_local_variable: ignore
+ unnecessary_import: ignore
\ No newline at end of file
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/AdditionalPropertiesClass.md b/samples/client/echo_api/dart/dio/built_value/doc/AdditionalPropertiesClass.md
new file mode 100644
index 000000000000..601ddeb51087
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/AdditionalPropertiesClass.md
@@ -0,0 +1,16 @@
+# openapi.model.AdditionalPropertiesClass
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapProperty** | **BuiltMap<String, String>** | | [optional]
+**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Addressable.md b/samples/client/echo_api/dart/dio/built_value/doc/Addressable.md
new file mode 100644
index 000000000000..d8b9beee9f52
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Addressable.md
@@ -0,0 +1,16 @@
+# openapi.model.Addressable
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/AllOfWithSingleRef.md b/samples/client/echo_api/dart/dio/built_value/doc/AllOfWithSingleRef.md
new file mode 100644
index 000000000000..b8c8c51c80af
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/AllOfWithSingleRef.md
@@ -0,0 +1,16 @@
+# openapi.model.AllOfWithSingleRef
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**username** | **String** | | [optional]
+**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Animal.md b/samples/client/echo_api/dart/dio/built_value/doc/Animal.md
new file mode 100644
index 000000000000..df78e9937613
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Animal.md
@@ -0,0 +1,16 @@
+# openapi.model.Animal
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional] [default to 'red']
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/AnotherFakeApi.md b/samples/client/echo_api/dart/dio/built_value/doc/AnotherFakeApi.md
new file mode 100644
index 000000000000..d45812aa3fde
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/AnotherFakeApi.md
@@ -0,0 +1,57 @@
+# openapi.api.AnotherFakeApi
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
+
+
+# **call123testSpecialTags**
+> ModelClient call123testSpecialTags(modelClient)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getAnotherFakeApi();
+final ModelClient modelClient = ; // ModelClient | client model
+
+try {
+ final response = api.call123testSpecialTags(modelClient);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **modelClient** | [**ModelClient**](ModelClient.md)| client model |
+
+### Return type
+
+[**ModelClient**](ModelClient.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ApiResponse.md b/samples/client/echo_api/dart/dio/built_value/doc/ApiResponse.md
new file mode 100644
index 000000000000..2928d50be81a
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ApiResponse.md
@@ -0,0 +1,17 @@
+# openapi.model.ApiResponse
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **int** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md b/samples/client/echo_api/dart/dio/built_value/doc/Apple.md
similarity index 75%
rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md
rename to samples/client/echo_api/dart/dio/built_value/doc/Apple.md
index 97a7c8fba492..14d4a3415182 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Apple.md
@@ -1,14 +1,14 @@
-# openapi.model.DogAllOf
+# openapi.model.Apple
## Load the model package
```dart
-import 'package:openapi/api.dart';
+import 'package:openapi/openapi.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**breed** | **String** | | [optional]
+**kind** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/AppleAllOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleAllOfDisc.md
new file mode 100644
index 000000000000..0e7d4c990e48
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/AppleAllOfDisc.md
@@ -0,0 +1,16 @@
+# openapi.model.AppleAllOfDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**seeds** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/AppleGrandparentDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleGrandparentDisc.md
new file mode 100644
index 000000000000..41bb14fd764b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/AppleGrandparentDisc.md
@@ -0,0 +1,16 @@
+# openapi.model.AppleGrandparentDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**seeds** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/AppleOneOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleOneOfDisc.md
new file mode 100644
index 000000000000..85eeb8a99eea
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/AppleOneOfDisc.md
@@ -0,0 +1,16 @@
+# openapi.model.AppleOneOfDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**seeds** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/AppleReqDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleReqDisc.md
new file mode 100644
index 000000000000..262c02ab50eb
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/AppleReqDisc.md
@@ -0,0 +1,16 @@
+# openapi.model.AppleReqDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**seeds** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/AppleVariant1.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleVariant1.md
new file mode 100644
index 000000000000..82de5e6a492a
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/AppleVariant1.md
@@ -0,0 +1,15 @@
+# openapi.model.AppleVariant1
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**kind** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md b/samples/client/echo_api/dart/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 000000000000..93a7169d0f72
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,15 @@
+# openapi.model.ArrayOfArrayOfNumberOnly
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayArrayNumber** | [**BuiltList<BuiltList<num>>**](BuiltList.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ArrayOfNumberOnly.md b/samples/client/echo_api/dart/dio/built_value/doc/ArrayOfNumberOnly.md
new file mode 100644
index 000000000000..7e739e91fc33
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ArrayOfNumberOnly.md
@@ -0,0 +1,15 @@
+# openapi.model.ArrayOfNumberOnly
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayNumber** | **BuiltList<num>** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ArrayTest.md b/samples/client/echo_api/dart/dio/built_value/doc/ArrayTest.md
new file mode 100644
index 000000000000..1dd8a3a41ac8
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ArrayTest.md
@@ -0,0 +1,17 @@
+# openapi.model.ArrayTest
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayOfString** | **BuiltList<String>** | | [optional]
+**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional]
+**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md b/samples/client/echo_api/dart/dio/built_value/doc/Banana.md
similarity index 75%
rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md
rename to samples/client/echo_api/dart/dio/built_value/doc/Banana.md
index 97a7c8fba492..cdae69466a61 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Banana.md
@@ -1,14 +1,14 @@
-# openapi.model.DogAllOf
+# openapi.model.Banana
## Load the model package
```dart
-import 'package:openapi/api.dart';
+import 'package:openapi/openapi.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**breed** | **String** | | [optional]
+**count** | **num** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/BananaAllOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/BananaAllOfDisc.md
new file mode 100644
index 000000000000..668b2bf1af02
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/BananaAllOfDisc.md
@@ -0,0 +1,16 @@
+# openapi.model.BananaAllOfDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**length** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/BananaGrandparentDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/BananaGrandparentDisc.md
new file mode 100644
index 000000000000..81bbb6cb54a6
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/BananaGrandparentDisc.md
@@ -0,0 +1,16 @@
+# openapi.model.BananaGrandparentDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**length** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/BananaOneOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/BananaOneOfDisc.md
new file mode 100644
index 000000000000..951cc5839179
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/BananaOneOfDisc.md
@@ -0,0 +1,16 @@
+# openapi.model.BananaOneOfDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**length** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/BananaReqDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/BananaReqDisc.md
new file mode 100644
index 000000000000..574a3383916b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/BananaReqDisc.md
@@ -0,0 +1,16 @@
+# openapi.model.BananaReqDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**length** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Bar.md b/samples/client/echo_api/dart/dio/built_value/doc/Bar.md
new file mode 100644
index 000000000000..e0668151935d
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Bar.md
@@ -0,0 +1,22 @@
+# openapi.model.Bar
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **String** | |
+**barPropA** | **String** | | [optional]
+**fooPropB** | **String** | | [optional]
+**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional]
+**href** | **String** | Hyperlink reference | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/BarApi.md b/samples/client/echo_api/dart/dio/built_value/doc/BarApi.md
new file mode 100644
index 000000000000..fd968c59c3ef
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/BarApi.md
@@ -0,0 +1,55 @@
+# openapi.api.BarApi
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createBar**](BarApi.md#createbar) | **POST** /bar | Create a Bar
+
+
+# **createBar**
+> Bar createBar(barCreate)
+
+Create a Bar
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getBarApi();
+final BarCreate barCreate = ; // BarCreate |
+
+try {
+ final response = api.createBar(barCreate);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling BarApi->createBar: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **barCreate** | [**BarCreate**](BarCreate.md)| |
+
+### Return type
+
+[**Bar**](Bar.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/BarCreate.md b/samples/client/echo_api/dart/dio/built_value/doc/BarCreate.md
new file mode 100644
index 000000000000..bb0dbfd55790
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/BarCreate.md
@@ -0,0 +1,22 @@
+# openapi.model.BarCreate
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**barPropA** | **String** | | [optional]
+**fooPropB** | **String** | | [optional]
+**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional]
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md b/samples/client/echo_api/dart/dio/built_value/doc/BarRef.md
similarity index 90%
rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md
rename to samples/client/echo_api/dart/dio/built_value/doc/BarRef.md
index 05aa2b0bbc1c..b9eab1af1a9b 100644
--- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md
+++ b/samples/client/echo_api/dart/dio/built_value/doc/BarRef.md
@@ -1,8 +1,8 @@
-# openapi.model.FooRefOrValueWithProperties
+# openapi.model.BarRef
## Load the model package
```dart
-import 'package:openapi/api.dart';
+import 'package:openapi/openapi.dart';
```
## Properties
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/BarRefOrValue.md b/samples/client/echo_api/dart/dio/built_value/doc/BarRefOrValue.md
new file mode 100644
index 000000000000..fea6617a3c12
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/BarRefOrValue.md
@@ -0,0 +1,19 @@
+# openapi.model.BarRefOrValue
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier |
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Capitalization.md b/samples/client/echo_api/dart/dio/built_value/doc/Capitalization.md
new file mode 100644
index 000000000000..7e933ba524a7
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Capitalization.md
@@ -0,0 +1,20 @@
+# openapi.model.Capitalization
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**smallCamel** | **String** | | [optional]
+**capitalCamel** | **String** | | [optional]
+**smallSnake** | **String** | | [optional]
+**capitalSnake** | **String** | | [optional]
+**sCAETHFlowPoints** | **String** | | [optional]
+**ATT_NAME** | **String** | Name of the pet | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Cat.md b/samples/client/echo_api/dart/dio/built_value/doc/Cat.md
new file mode 100644
index 000000000000..b7998f19f95f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Cat.md
@@ -0,0 +1,17 @@
+# openapi.model.Cat
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional] [default to 'red']
+**declawed** | **bool** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Category.md b/samples/client/echo_api/dart/dio/built_value/doc/Category.md
new file mode 100644
index 000000000000..5e51f5aa35bc
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Category.md
@@ -0,0 +1,16 @@
+# openapi.model.Category
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**name** | **String** | | [default to 'default-name']
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ClassModel.md b/samples/client/echo_api/dart/dio/built_value/doc/ClassModel.md
new file mode 100644
index 000000000000..20a4715e3ca0
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ClassModel.md
@@ -0,0 +1,15 @@
+# openapi.model.ClassModel
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**classField** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscMissingFromProperties.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscMissingFromProperties.md
new file mode 100644
index 000000000000..4137cc1a0add
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscMissingFromProperties.md
@@ -0,0 +1,15 @@
+# openapi.model.ComposedDiscMissingFromProperties
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**length** | **int** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md
new file mode 100644
index 000000000000..ab27d1c4473a
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md
@@ -0,0 +1,15 @@
+# openapi.model.ComposedDiscOptionalTypeCorrect
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md
new file mode 100644
index 000000000000..8c32b4c72b6b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md
@@ -0,0 +1,15 @@
+# openapi.model.ComposedDiscOptionalTypeInconsistent
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md
new file mode 100644
index 000000000000..4f0fab65accc
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md
@@ -0,0 +1,15 @@
+# openapi.model.ComposedDiscOptionalTypeIncorrect
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **int** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscRequiredInconsistent.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscRequiredInconsistent.md
new file mode 100644
index 000000000000..bc60f26b183c
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscRequiredInconsistent.md
@@ -0,0 +1,15 @@
+# openapi.model.ComposedDiscRequiredInconsistent
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeInconsistent.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeInconsistent.md
new file mode 100644
index 000000000000..0cdb9b880b9f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeInconsistent.md
@@ -0,0 +1,15 @@
+# openapi.model.ComposedDiscTypeInconsistent
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeIncorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeIncorrect.md
new file mode 100644
index 000000000000..8000df558df6
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeIncorrect.md
@@ -0,0 +1,15 @@
+# openapi.model.ComposedDiscTypeIncorrect
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **int** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/DefaultApi.md b/samples/client/echo_api/dart/dio/built_value/doc/DefaultApi.md
new file mode 100644
index 000000000000..27ab9220443c
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/DefaultApi.md
@@ -0,0 +1,244 @@
+# openapi.api.DefaultApi
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**fooBasicGet**](DefaultApi.md#foobasicget) | **GET** /foo-basic |
+[**list**](DefaultApi.md#list) | **GET** /oneof-primitive |
+[**oneofGet**](DefaultApi.md#oneofget) | **GET** /oneof |
+[**test**](DefaultApi.md#test) | **PUT** /variant1 |
+[**variant1Get**](DefaultApi.md#variant1get) | **GET** /variant1 |
+[**variant2Get**](DefaultApi.md#variant2get) | **GET** /variant2 |
+
+
+# **fooBasicGet**
+> FooBasicGetDefaultResponse fooBasicGet()
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getDefaultApi();
+
+try {
+ final response = api.fooBasicGet();
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling DefaultApi->fooBasicGet: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**FooBasicGetDefaultResponse**](FooBasicGetDefaultResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **list**
+> GigaOneOf list()
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getDefaultApi();
+
+try {
+ final response = api.list();
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling DefaultApi->list: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**GigaOneOf**](GigaOneOf.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **oneofGet**
+> Fruit oneofGet()
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getDefaultApi();
+
+try {
+ final response = api.oneofGet();
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling DefaultApi->oneofGet: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**Fruit**](Fruit.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test**
+> test(body)
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getDefaultApi();
+final JsonObject body = ; // JsonObject |
+
+try {
+ api.test(body);
+} catch on DioException (e) {
+ print('Exception when calling DefaultApi->test: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **JsonObject**| | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **variant1Get**
+> FruitVariant1 variant1Get()
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getDefaultApi();
+
+try {
+ final response = api.variant1Get();
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling DefaultApi->variant1Get: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**FruitVariant1**](FruitVariant1.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **variant2Get**
+> FruitAllOfDisc variant2Get()
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getDefaultApi();
+
+try {
+ final response = api.variant2Get();
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling DefaultApi->variant2Get: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**FruitAllOfDisc**](FruitAllOfDisc.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/DeprecatedObject.md b/samples/client/echo_api/dart/dio/built_value/doc/DeprecatedObject.md
new file mode 100644
index 000000000000..76215e98669f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/DeprecatedObject.md
@@ -0,0 +1,15 @@
+# openapi.model.DeprecatedObject
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/DiscMissingFromProperties.md b/samples/client/echo_api/dart/dio/built_value/doc/DiscMissingFromProperties.md
new file mode 100644
index 000000000000..c38a5c2b5226
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/DiscMissingFromProperties.md
@@ -0,0 +1,15 @@
+# openapi.model.DiscMissingFromProperties
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**length** | **int** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeCorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeCorrect.md
new file mode 100644
index 000000000000..38601f552917
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeCorrect.md
@@ -0,0 +1,15 @@
+# openapi.model.DiscOptionalTypeCorrect
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeIncorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeIncorrect.md
new file mode 100644
index 000000000000..b6787edea47b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeIncorrect.md
@@ -0,0 +1,15 @@
+# openapi.model.DiscOptionalTypeIncorrect
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **int** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/DiscTypeIncorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/DiscTypeIncorrect.md
new file mode 100644
index 000000000000..519a8e0333e7
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/DiscTypeIncorrect.md
@@ -0,0 +1,15 @@
+# openapi.model.DiscTypeIncorrect
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **int** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Dog.md b/samples/client/echo_api/dart/dio/built_value/doc/Dog.md
new file mode 100644
index 000000000000..712ed082eb91
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Dog.md
@@ -0,0 +1,17 @@
+# openapi.model.Dog
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional] [default to 'red']
+**breed** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Entity.md b/samples/client/echo_api/dart/dio/built_value/doc/Entity.md
new file mode 100644
index 000000000000..ccf43340ed10
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Entity.md
@@ -0,0 +1,19 @@
+# openapi.model.Entity
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/EntityRef.md b/samples/client/echo_api/dart/dio/built_value/doc/EntityRef.md
new file mode 100644
index 000000000000..6fad4884910f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/EntityRef.md
@@ -0,0 +1,21 @@
+# openapi.model.EntityRef
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Name of the related entity. | [optional]
+**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional]
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/EnumArrays.md b/samples/client/echo_api/dart/dio/built_value/doc/EnumArrays.md
new file mode 100644
index 000000000000..7d18f70dbf85
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/EnumArrays.md
@@ -0,0 +1,16 @@
+# openapi.model.EnumArrays
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justSymbol** | **String** | | [optional]
+**arrayEnum** | **BuiltList<String>** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/EnumTest.md b/samples/client/echo_api/dart/dio/built_value/doc/EnumTest.md
new file mode 100644
index 000000000000..8dc105ee3146
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/EnumTest.md
@@ -0,0 +1,22 @@
+# openapi.model.EnumTest
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enumString** | **String** | | [optional]
+**enumStringRequired** | **String** | |
+**enumInteger** | **int** | | [optional]
+**enumNumber** | **double** | | [optional]
+**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
+**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
+**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Extensible.md b/samples/client/echo_api/dart/dio/built_value/doc/Extensible.md
new file mode 100644
index 000000000000..76e8c3340955
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Extensible.md
@@ -0,0 +1,17 @@
+# openapi.model.Extensible
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FakeApi.md b/samples/client/echo_api/dart/dio/built_value/doc/FakeApi.md
new file mode 100644
index 000000000000..a93c2ba8f348
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FakeApi.md
@@ -0,0 +1,816 @@
+# openapi.api.FakeApi
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
+[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
+[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
+[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
+[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
+[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
+[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
+[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
+[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
+[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
+[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
+[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
+[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
+[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters |
+
+
+# **fakeHealthGet**
+> HealthCheckResult fakeHealthGet()
+
+Health check endpoint
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+
+try {
+ final response = api.fakeHealthGet();
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->fakeHealthGet: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**HealthCheckResult**](HealthCheckResult.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fakeHttpSignatureTest**
+> fakeHttpSignatureTest(pet, query1, header1)
+
+test http signature authentication
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final Pet pet = ; // Pet | Pet object that needs to be added to the store
+final String query1 = query1_example; // String | query parameter
+final String header1 = header1_example; // String | header parameter
+
+try {
+ api.fakeHttpSignatureTest(pet, query1, header1);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **query1** | **String**| query parameter | [optional]
+ **header1** | **String**| header parameter | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fakeOuterBooleanSerialize**
+> bool fakeOuterBooleanSerialize(body)
+
+
+
+Test serialization of outer boolean types
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final bool body = true; // bool | Input boolean as post body
+
+try {
+ final response = api.fakeOuterBooleanSerialize(body);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **bool**| Input boolean as post body | [optional]
+
+### Return type
+
+**bool**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fakeOuterCompositeSerialize**
+> OuterComposite fakeOuterCompositeSerialize(outerComposite)
+
+
+
+Test serialization of object with outer number type
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body
+
+try {
+ final response = api.fakeOuterCompositeSerialize(outerComposite);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fakeOuterNumberSerialize**
+> num fakeOuterNumberSerialize(body)
+
+
+
+Test serialization of outer number types
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final num body = 8.14; // num | Input number as post body
+
+try {
+ final response = api.fakeOuterNumberSerialize(body);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **num**| Input number as post body | [optional]
+
+### Return type
+
+**num**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fakeOuterStringSerialize**
+> String fakeOuterStringSerialize(body)
+
+
+
+Test serialization of outer string types
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final String body = body_example; // String | Input string as post body
+
+try {
+ final response = api.fakeOuterStringSerialize(body);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **String**| Input string as post body | [optional]
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fakePropertyEnumIntegerSerialize**
+> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty)
+
+
+
+Test serialization of enum (int) properties with examples
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body
+
+try {
+ final response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body |
+
+### Return type
+
+[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testBodyWithBinary**
+> testBodyWithBinary(body)
+
+
+
+For this test, the body has to be a binary file.
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload
+
+try {
+ api.testBodyWithBinary(body);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testBodyWithBinary: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **MultipartFile**| image to upload |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: image/png
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testBodyWithFileSchema**
+> testBodyWithFileSchema(fileSchemaTestClass)
+
+
+
+For this test, the body for this request must reference a schema named `File`.
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass |
+
+try {
+ api.testBodyWithFileSchema(fileSchemaTestClass);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testBodyWithQueryParams**
+> testBodyWithQueryParams(query, user)
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final String query = query_example; // String |
+final User user = ; // User |
+
+try {
+ api.testBodyWithQueryParams(query, user);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **query** | **String**| |
+ **user** | [**User**](User.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testClientModel**
+> ModelClient testClientModel(modelClient)
+
+To test \"client\" model
+
+To test \"client\" model
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final ModelClient modelClient = ; // ModelClient | client model
+
+try {
+ final response = api.testClientModel(modelClient);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testClientModel: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **modelClient** | [**ModelClient**](ModelClient.md)| client model |
+
+### Return type
+
+[**ModelClient**](ModelClient.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testEndpointParameters**
+> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure HTTP basic authorization: http_basic_test
+//defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME'
+//defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD';
+
+final api = Openapi().getFakeApi();
+final num number = 8.14; // num | None
+final double double_ = 1.2; // double | None
+final String patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None
+final String byte = BYTE_ARRAY_DATA_HERE; // String | None
+final int integer = 56; // int | None
+final int int32 = 56; // int | None
+final int int64 = 789; // int | None
+final double float = 3.4; // double | None
+final String string = string_example; // String | None
+final Uint8List binary = BINARY_DATA_HERE; // Uint8List | None
+final Date date = 2013-10-20; // Date | None
+final DateTime dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None
+final String password = password_example; // String | None
+final String callback = callback_example; // String | None
+
+try {
+ api.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testEndpointParameters: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **num**| None |
+ **double_** | **double**| None |
+ **patternWithoutDelimiter** | **String**| None |
+ **byte** | **String**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **float** | **double**| None | [optional]
+ **string** | **String**| None | [optional]
+ **binary** | **Uint8List**| None | [optional]
+ **date** | **Date**| None | [optional]
+ **dateTime** | **DateTime**| None | [optional]
+ **password** | **String**| None | [optional]
+ **callback** | **String**| None | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_basic_test](../README.md#http_basic_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testEnumParameters**
+> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString)
+
+To test enum parameters
+
+To test enum parameters
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final BuiltList enumHeaderStringArray = ; // BuiltList | Header parameter enum test (string array)
+final String enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string)
+final BuiltList enumQueryStringArray = ; // BuiltList | Query parameter enum test (string array)
+final String enumQueryString = enumQueryString_example; // String | Query parameter enum test (string)
+final int enumQueryInteger = 56; // int | Query parameter enum test (double)
+final double enumQueryDouble = 1.2; // double | Query parameter enum test (double)
+final BuiltList enumQueryModelArray = ; // BuiltList |
+final BuiltList enumFormStringArray = ; // BuiltList | Form parameter enum test (string array)
+final String enumFormString = enumFormString_example; // String | Form parameter enum test (string)
+
+try {
+ api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testEnumParameters: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional]
+ **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to r'-efg']
+ **enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional]
+ **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to r'-efg']
+ **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional]
+ **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional]
+ **enumQueryModelArray** | [**BuiltList<ModelEnumClass>**](ModelEnumClass.md)| | [optional]
+ **enumFormStringArray** | [**BuiltList<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to r'$']
+ **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to r'-efg']
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testGroupParameters**
+> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final int requiredStringGroup = 56; // int | Required String in group parameters
+final bool requiredBooleanGroup = true; // bool | Required Boolean in group parameters
+final int requiredInt64Group = 789; // int | Required Integer in group parameters
+final int stringGroup = 56; // int | String in group parameters
+final bool booleanGroup = true; // bool | Boolean in group parameters
+final int int64Group = 789; // int | Integer in group parameters
+
+try {
+ api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testGroupParameters: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **requiredStringGroup** | **int**| Required String in group parameters |
+ **requiredBooleanGroup** | **bool**| Required Boolean in group parameters |
+ **requiredInt64Group** | **int**| Required Integer in group parameters |
+ **stringGroup** | **int**| String in group parameters | [optional]
+ **booleanGroup** | **bool**| Boolean in group parameters | [optional]
+ **int64Group** | **int**| Integer in group parameters | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[bearer_test](../README.md#bearer_test)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testInlineAdditionalProperties**
+> testInlineAdditionalProperties(requestBody)
+
+test inline additionalProperties
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final BuiltMap requestBody = ; // BuiltMap | request body
+
+try {
+ api.testInlineAdditionalProperties(requestBody);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **requestBody** | [**BuiltMap<String, String>**](String.md)| request body |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testJsonFormData**
+> testJsonFormData(param, param2)
+
+test json serialization of form data
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final String param = param_example; // String | field1
+final String param2 = param2_example; // String | field2
+
+try {
+ api.testJsonFormData(param, param2);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testJsonFormData: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | **String**| field1 |
+ **param2** | **String**| field2 |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **testQueryParameterCollectionFormat**
+> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language)
+
+
+
+To test the collection format in query parameters
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFakeApi();
+final BuiltList pipe = ; // BuiltList |
+final BuiltList ioutil = ; // BuiltList |
+final BuiltList http = ; // BuiltList |
+final BuiltList url = ; // BuiltList |
+final BuiltList context = ; // BuiltList |
+final String allowEmpty = allowEmpty_example; // String |
+final BuiltMap language = ; // BuiltMap |
+
+try {
+ api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language);
+} catch on DioException (e) {
+ print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pipe** | [**BuiltList<String>**](String.md)| |
+ **ioutil** | [**BuiltList<String>**](String.md)| |
+ **http** | [**BuiltList<String>**](String.md)| |
+ **url** | [**BuiltList<String>**](String.md)| |
+ **context** | [**BuiltList<String>**](String.md)| |
+ **allowEmpty** | **String**| |
+ **language** | [**BuiltMap<String, String>**](String.md)| | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FakeClassnameTags123Api.md b/samples/client/echo_api/dart/dio/built_value/doc/FakeClassnameTags123Api.md
new file mode 100644
index 000000000000..663901532d62
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FakeClassnameTags123Api.md
@@ -0,0 +1,61 @@
+# openapi.api.FakeClassnameTags123Api
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
+
+
+# **testClassname**
+> ModelClient testClassname(modelClient)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure API key authorization: api_key_query
+//defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY';
+// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+//defaultApiClient.getAuthentication('api_key_query').apiKeyPrefix = 'Bearer';
+
+final api = Openapi().getFakeClassnameTags123Api();
+final ModelClient modelClient = ; // ModelClient | client model
+
+try {
+ final response = api.testClassname(modelClient);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **modelClient** | [**ModelClient**](ModelClient.md)| client model |
+
+### Return type
+
+[**ModelClient**](ModelClient.md)
+
+### Authorization
+
+[api_key_query](../README.md#api_key_query)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FileSchemaTestClass.md b/samples/client/echo_api/dart/dio/built_value/doc/FileSchemaTestClass.md
new file mode 100644
index 000000000000..83d57e45bce5
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FileSchemaTestClass.md
@@ -0,0 +1,16 @@
+# openapi.model.FileSchemaTestClass
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**file** | [**ModelFile**](ModelFile.md) | | [optional]
+**files** | [**BuiltList<ModelFile>**](ModelFile.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Foo.md b/samples/client/echo_api/dart/dio/built_value/doc/Foo.md
new file mode 100644
index 000000000000..c03233a1b1df
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Foo.md
@@ -0,0 +1,21 @@
+# openapi.model.Foo
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fooPropA** | **String** | | [optional]
+**fooPropB** | **String** | | [optional]
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FooApi.md b/samples/client/echo_api/dart/dio/built_value/doc/FooApi.md
new file mode 100644
index 000000000000..463bd59a8a15
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FooApi.md
@@ -0,0 +1,93 @@
+# openapi.api.FooApi
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createFoo**](FooApi.md#createfoo) | **POST** /foo | Create a Foo
+[**getAllFoos**](FooApi.md#getallfoos) | **GET** /foo | GET all Foos
+
+
+# **createFoo**
+> FooRefOrValue createFoo(foo)
+
+Create a Foo
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFooApi();
+final Foo foo = ; // Foo | The Foo to be created
+
+try {
+ final response = api.createFoo(foo);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FooApi->createFoo: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **foo** | [**Foo**](Foo.md)| The Foo to be created | [optional]
+
+### Return type
+
+[**FooRefOrValue**](FooRefOrValue.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json;charset=utf-8
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **getAllFoos**
+> BuiltList getAllFoos()
+
+GET all Foos
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getFooApi();
+
+try {
+ final response = api.getAllFoos();
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling FooApi->getAllFoos: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**BuiltList<FooRefOrValue>**](FooRefOrValue.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json;charset=utf-8
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md b/samples/client/echo_api/dart/dio/built_value/doc/FooBasicGetDefaultResponse.md
similarity index 81%
rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md
rename to samples/client/echo_api/dart/dio/built_value/doc/FooBasicGetDefaultResponse.md
index c5e61e1162bf..504630ea31a9 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FooBasicGetDefaultResponse.md
@@ -1,8 +1,8 @@
-# openapi.model.InlineResponseDefault
+# openapi.model.FooBasicGetDefaultResponse
## Load the model package
```dart
-import 'package:openapi/api.dart';
+import 'package:openapi/openapi.dart';
```
## Properties
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FooRef.md b/samples/client/echo_api/dart/dio/built_value/doc/FooRef.md
new file mode 100644
index 000000000000..d49ad9b8a84f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FooRef.md
@@ -0,0 +1,20 @@
+# openapi.model.FooRef
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**foorefPropA** | **String** | | [optional]
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FooRefOrValue.md b/samples/client/echo_api/dart/dio/built_value/doc/FooRefOrValue.md
new file mode 100644
index 000000000000..e79adafd24e7
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FooRefOrValue.md
@@ -0,0 +1,19 @@
+# openapi.model.FooRefOrValue
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FormatTest.md b/samples/client/echo_api/dart/dio/built_value/doc/FormatTest.md
new file mode 100644
index 000000000000..cb4c2f81d133
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FormatTest.md
@@ -0,0 +1,30 @@
+# openapi.model.FormatTest
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **int** | | [optional]
+**int32** | **int** | | [optional]
+**int64** | **int** | | [optional]
+**number** | **num** | |
+**float** | **double** | | [optional]
+**double_** | **double** | | [optional]
+**decimal** | **double** | | [optional]
+**string** | **String** | | [optional]
+**byte** | **String** | |
+**binary** | [**Uint8List**](Uint8List.md) | | [optional]
+**date** | [**Date**](Date.md) | |
+**dateTime** | [**DateTime**](DateTime.md) | | [optional]
+**uuid** | **String** | | [optional]
+**password** | **String** | |
+**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional]
+**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Fruit.md b/samples/client/echo_api/dart/dio/built_value/doc/Fruit.md
new file mode 100644
index 000000000000..fd6be273d730
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Fruit.md
@@ -0,0 +1,17 @@
+# openapi.model.Fruit
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**color** | **String** | | [optional]
+**kind** | **String** | | [optional]
+**count** | **num** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitAllOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitAllOfDisc.md
new file mode 100644
index 000000000000..f63fe99752c0
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitAllOfDisc.md
@@ -0,0 +1,15 @@
+# openapi.model.FruitAllOfDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitAnyOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitAnyOfDisc.md
new file mode 100644
index 000000000000..c77b16556c53
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitAnyOfDisc.md
@@ -0,0 +1,15 @@
+# openapi.model.FruitAnyOfDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitGrandparentDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitGrandparentDisc.md
new file mode 100644
index 000000000000..ce9687bf5a6a
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitGrandparentDisc.md
@@ -0,0 +1,15 @@
+# openapi.model.FruitGrandparentDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDisc.md
new file mode 100644
index 000000000000..634614481813
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDisc.md
@@ -0,0 +1,17 @@
+# openapi.model.FruitInlineDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**seeds** | **int** | |
+**fruitType** | **String** | |
+**length** | **int** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf.md
new file mode 100644
index 000000000000..c842f7706c46
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf.md
@@ -0,0 +1,16 @@
+# openapi.model.FruitInlineDiscOneOf
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**seeds** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf1.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf1.md
new file mode 100644
index 000000000000..2ab55f905a67
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf1.md
@@ -0,0 +1,16 @@
+# openapi.model.FruitInlineDiscOneOf1
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**length** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDisc.md
new file mode 100644
index 000000000000..a94f2de1f3bc
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDisc.md
@@ -0,0 +1,15 @@
+# openapi.model.FruitInlineInlineDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf.md
new file mode 100644
index 000000000000..511b8519164e
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf.md
@@ -0,0 +1,16 @@
+# openapi.model.FruitInlineInlineDiscOneOf
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**seeds** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md
new file mode 100644
index 000000000000..59d09becd314
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md
@@ -0,0 +1,16 @@
+# openapi.model.FruitInlineInlineDiscOneOf1
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**length** | **int** | |
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md
new file mode 100644
index 000000000000..5267793720af
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md
@@ -0,0 +1,15 @@
+# openapi.model.FruitInlineInlineDiscOneOfOneOf
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitOneOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitOneOfDisc.md
new file mode 100644
index 000000000000..98c529e8c203
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitOneOfDisc.md
@@ -0,0 +1,15 @@
+# openapi.model.FruitOneOfDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitReqDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitReqDisc.md
new file mode 100644
index 000000000000..6ed06ec95a84
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitReqDisc.md
@@ -0,0 +1,17 @@
+# openapi.model.FruitReqDisc
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**seeds** | **int** | |
+**fruitType** | **String** | |
+**length** | **int** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitType.md
similarity index 75%
rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md
rename to samples/client/echo_api/dart/dio/built_value/doc/FruitType.md
index 36b2ae0e8ab3..a5ac48ebfcef 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitType.md
@@ -1,14 +1,14 @@
-# openapi.model.CatAllOf
+# openapi.model.FruitType
## Load the model package
```dart
-import 'package:openapi/api.dart';
+import 'package:openapi/openapi.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**declawed** | **bool** | | [optional]
+**fruitType** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/FruitVariant1.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitVariant1.md
new file mode 100644
index 000000000000..f56649903b0f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/FruitVariant1.md
@@ -0,0 +1,16 @@
+# openapi.model.FruitVariant1
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**color** | **String** | | [optional]
+**kind** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/GigaOneOf.md b/samples/client/echo_api/dart/dio/built_value/doc/GigaOneOf.md
new file mode 100644
index 000000000000..c4148a9477f6
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/GigaOneOf.md
@@ -0,0 +1,15 @@
+# openapi.model.GigaOneOf
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/GrapeVariant1.md b/samples/client/echo_api/dart/dio/built_value/doc/GrapeVariant1.md
new file mode 100644
index 000000000000..ac6637c2a1c9
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/GrapeVariant1.md
@@ -0,0 +1,15 @@
+# openapi.model.GrapeVariant1
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**color** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/HasOnlyReadOnly.md b/samples/client/echo_api/dart/dio/built_value/doc/HasOnlyReadOnly.md
new file mode 100644
index 000000000000..c0884669d1a6
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/HasOnlyReadOnly.md
@@ -0,0 +1,16 @@
+# openapi.model.HasOnlyReadOnly
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional]
+**foo** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/HealthCheckResult.md b/samples/client/echo_api/dart/dio/built_value/doc/HealthCheckResult.md
new file mode 100644
index 000000000000..30abe9693f7e
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/HealthCheckResult.md
@@ -0,0 +1,15 @@
+# openapi.model.HealthCheckResult
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**nullableMessage** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/MapTest.md b/samples/client/echo_api/dart/dio/built_value/doc/MapTest.md
new file mode 100644
index 000000000000..0f6c09f04b84
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/MapTest.md
@@ -0,0 +1,18 @@
+# openapi.model.MapTest
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapMapOfString** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional]
+**mapOfEnumString** | **BuiltMap<String, String>** | | [optional]
+**directMap** | **BuiltMap<String, bool>** | | [optional]
+**indirectMap** | **BuiltMap<String, bool>** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/echo_api/dart/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 000000000000..30967b4a65c2
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,17 @@
+# openapi.model.MixedPropertiesAndAdditionalPropertiesClass
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **String** | | [optional]
+**dateTime** | [**DateTime**](DateTime.md) | | [optional]
+**map** | [**BuiltMap<String, Animal>**](Animal.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Model200Response.md b/samples/client/echo_api/dart/dio/built_value/doc/Model200Response.md
new file mode 100644
index 000000000000..f42d7b1dfe3c
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Model200Response.md
@@ -0,0 +1,16 @@
+# openapi.model.Model200Response
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | | [optional]
+**classField** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ModelClient.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelClient.md
new file mode 100644
index 000000000000..491c2dffa0c3
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ModelClient.md
@@ -0,0 +1,15 @@
+# openapi.model.ModelClient
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**client** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelEnumClass.md
similarity index 75%
rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md
rename to samples/client/echo_api/dart/dio/built_value/doc/ModelEnumClass.md
index 36b2ae0e8ab3..6346922b80fa 100644
--- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ModelEnumClass.md
@@ -1,14 +1,13 @@
-# openapi.model.CatAllOf
+# openapi.model.ModelEnumClass
## Load the model package
```dart
-import 'package:openapi/api.dart';
+import 'package:openapi/openapi.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**declawed** | **bool** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ModelFile.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelFile.md
new file mode 100644
index 000000000000..810d321ec7f0
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ModelFile.md
@@ -0,0 +1,15 @@
+# openapi.model.ModelFile
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**sourceURI** | **String** | Test capitalization | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ModelList.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelList.md
new file mode 100644
index 000000000000..95bbed7bd916
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ModelList.md
@@ -0,0 +1,15 @@
+# openapi.model.ModelList
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**n123list** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ModelReturn.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelReturn.md
new file mode 100644
index 000000000000..49e007d35af6
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ModelReturn.md
@@ -0,0 +1,15 @@
+# openapi.model.ModelReturn
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**return_** | **int** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Name.md b/samples/client/echo_api/dart/dio/built_value/doc/Name.md
new file mode 100644
index 000000000000..7f8db15a7c71
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Name.md
@@ -0,0 +1,18 @@
+# openapi.model.Name
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | |
+**snakeCase** | **int** | | [optional]
+**property** | **String** | | [optional]
+**n123number** | **int** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/NullableClass.md b/samples/client/echo_api/dart/dio/built_value/doc/NullableClass.md
new file mode 100644
index 000000000000..9760a2d6c04d
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/NullableClass.md
@@ -0,0 +1,26 @@
+# openapi.model.NullableClass
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integerProp** | **int** | | [optional]
+**numberProp** | **num** | | [optional]
+**booleanProp** | **bool** | | [optional]
+**stringProp** | **String** | | [optional]
+**dateProp** | [**Date**](Date.md) | | [optional]
+**datetimeProp** | [**DateTime**](DateTime.md) | | [optional]
+**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional]
+**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional]
+**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional]
+**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional]
+**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional]
+**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/NumberOnly.md b/samples/client/echo_api/dart/dio/built_value/doc/NumberOnly.md
new file mode 100644
index 000000000000..12d634cfdbbd
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/NumberOnly.md
@@ -0,0 +1,15 @@
+# openapi.model.NumberOnly
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justNumber** | **num** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ObjectWithDeprecatedFields.md b/samples/client/echo_api/dart/dio/built_value/doc/ObjectWithDeprecatedFields.md
new file mode 100644
index 000000000000..97a6433501e8
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ObjectWithDeprecatedFields.md
@@ -0,0 +1,18 @@
+# openapi.model.ObjectWithDeprecatedFields
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **String** | | [optional]
+**id** | **num** | | [optional]
+**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
+**bars** | [**BuiltList<Bar>**](Bar.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/OneOfPrimitiveChild.md b/samples/client/echo_api/dart/dio/built_value/doc/OneOfPrimitiveChild.md
new file mode 100644
index 000000000000..cb1eec1c5b7f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/OneOfPrimitiveChild.md
@@ -0,0 +1,15 @@
+# openapi.model.OneOfPrimitiveChild
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Order.md b/samples/client/echo_api/dart/dio/built_value/doc/Order.md
new file mode 100644
index 000000000000..d18d3d8408ad
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Order.md
@@ -0,0 +1,20 @@
+# openapi.model.Order
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**petId** | **int** | | [optional]
+**quantity** | **int** | | [optional]
+**shipDate** | [**DateTime**](DateTime.md) | | [optional]
+**status** | **String** | Order Status | [optional]
+**complete** | **bool** | | [optional] [default to false]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/OuterComposite.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterComposite.md
new file mode 100644
index 000000000000..fab14cb2d17d
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/OuterComposite.md
@@ -0,0 +1,17 @@
+# openapi.model.OuterComposite
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**myNumber** | **num** | | [optional]
+**myString** | **String** | | [optional]
+**myBoolean** | **bool** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/OuterEnum.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnum.md
new file mode 100644
index 000000000000..77123453e019
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnum.md
@@ -0,0 +1,14 @@
+# openapi.model.OuterEnum
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumDefaultValue.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumDefaultValue.md
new file mode 100644
index 000000000000..715afba3433f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumDefaultValue.md
@@ -0,0 +1,14 @@
+# openapi.model.OuterEnumDefaultValue
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumInteger.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumInteger.md
new file mode 100644
index 000000000000..98e74cfbc21e
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumInteger.md
@@ -0,0 +1,14 @@
+# openapi.model.OuterEnumInteger
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumIntegerDefaultValue.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumIntegerDefaultValue.md
new file mode 100644
index 000000000000..14b955ed876f
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumIntegerDefaultValue.md
@@ -0,0 +1,14 @@
+# openapi.model.OuterEnumIntegerDefaultValue
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/OuterObjectWithEnumProperty.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterObjectWithEnumProperty.md
new file mode 100644
index 000000000000..881373f258bb
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/OuterObjectWithEnumProperty.md
@@ -0,0 +1,15 @@
+# openapi.model.OuterObjectWithEnumProperty
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Parent.md b/samples/client/echo_api/dart/dio/built_value/doc/Parent.md
new file mode 100644
index 000000000000..cb343a1e4f5a
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Parent.md
@@ -0,0 +1,15 @@
+# openapi.model.Parent
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**fruitType** | **String** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Pasta.md b/samples/client/echo_api/dart/dio/built_value/doc/Pasta.md
new file mode 100644
index 000000000000..027d4e96abe0
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Pasta.md
@@ -0,0 +1,20 @@
+# openapi.model.Pasta
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**vendor** | **String** | | [optional]
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Pet.md b/samples/client/echo_api/dart/dio/built_value/doc/Pet.md
new file mode 100644
index 000000000000..0e84c434698b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Pet.md
@@ -0,0 +1,20 @@
+# openapi.model.Pet
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **String** | |
+**photoUrls** | **BuiltSet<String>** | |
+**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional]
+**status** | **String** | pet status in the store | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/PetApi.md b/samples/client/echo_api/dart/dio/built_value/doc/PetApi.md
new file mode 100644
index 000000000000..5453eed90025
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/PetApi.md
@@ -0,0 +1,439 @@
+# openapi.api.PetApi
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
+[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
+[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
+[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
+[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
+[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
+[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+
+
+# **addPet**
+> addPet(pet)
+
+Add a new pet to the store
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure OAuth2 access token for authorization: petstore_auth
+//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
+
+final api = Openapi().getPetApi();
+final Pet pet = ; // Pet | Pet object that needs to be added to the store
+
+try {
+ api.addPet(pet);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->addPet: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **deletePet**
+> deletePet(petId, apiKey)
+
+Deletes a pet
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure OAuth2 access token for authorization: petstore_auth
+//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
+
+final api = Openapi().getPetApi();
+final int petId = 789; // int | Pet id to delete
+final String apiKey = apiKey_example; // String |
+
+try {
+ api.deletePet(petId, apiKey);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->deletePet: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **int**| Pet id to delete |
+ **apiKey** | **String**| | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **findPetsByStatus**
+> BuiltList findPetsByStatus(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure OAuth2 access token for authorization: petstore_auth
+//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
+
+final api = Openapi().getPetApi();
+final BuiltList status = ; // BuiltList | Status values that need to be considered for filter
+
+try {
+ final response = api.findPetsByStatus(status);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->findPetsByStatus: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter |
+
+### Return type
+
+[**BuiltList<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **findPetsByTags**
+> BuiltSet findPetsByTags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure OAuth2 access token for authorization: petstore_auth
+//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
+
+final api = Openapi().getPetApi();
+final BuiltSet tags = ; // BuiltSet | Tags to filter by
+
+try {
+ final response = api.findPetsByTags(tags);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->findPetsByTags: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**BuiltSet<String>**](String.md)| Tags to filter by |
+
+### Return type
+
+[**BuiltSet<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **getPetById**
+> Pet getPetById(petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure API key authorization: api_key
+//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY';
+// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer';
+
+final api = Openapi().getPetApi();
+final int petId = 789; // int | ID of pet to return
+
+try {
+ final response = api.getPetById(petId);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->getPetById: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **int**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **updatePet**
+> updatePet(pet)
+
+Update an existing pet
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure OAuth2 access token for authorization: petstore_auth
+//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
+
+final api = Openapi().getPetApi();
+final Pet pet = ; // Pet | Pet object that needs to be added to the store
+
+try {
+ api.updatePet(pet);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->updatePet: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **updatePetWithForm**
+> updatePetWithForm(petId, name, status)
+
+Updates a pet in the store with form data
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure OAuth2 access token for authorization: petstore_auth
+//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
+
+final api = Openapi().getPetApi();
+final int petId = 789; // int | ID of pet that needs to be updated
+final String name = name_example; // String | Updated name of the pet
+final String status = status_example; // String | Updated status of the pet
+
+try {
+ api.updatePetWithForm(petId, name, status);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->updatePetWithForm: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **int**| ID of pet that needs to be updated |
+ **name** | **String**| Updated name of the pet | [optional]
+ **status** | **String**| Updated status of the pet | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **uploadFile**
+> ApiResponse uploadFile(petId, additionalMetadata, file)
+
+uploads an image
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure OAuth2 access token for authorization: petstore_auth
+//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
+
+final api = Openapi().getPetApi();
+final int petId = 789; // int | ID of pet to update
+final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
+final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload
+
+try {
+ final response = api.uploadFile(petId, additionalMetadata, file);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->uploadFile: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **int**| ID of pet to update |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+ **file** | **MultipartFile**| file to upload | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **uploadFileWithRequiredFile**
+> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
+
+uploads an image (required)
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure OAuth2 access token for authorization: petstore_auth
+//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
+
+final api = Openapi().getPetApi();
+final int petId = 789; // int | ID of pet to update
+final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload
+final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
+
+try {
+ final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **int**| ID of pet to update |
+ **requiredFile** | **MultipartFile**| file to upload |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+
+### Return type
+
+[**ApiResponse**](ApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Pizza.md b/samples/client/echo_api/dart/dio/built_value/doc/Pizza.md
new file mode 100644
index 000000000000..a9a0163a18e3
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Pizza.md
@@ -0,0 +1,20 @@
+# openapi.model.Pizza
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**pizzaSize** | **num** | | [optional]
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/PizzaSpeziale.md b/samples/client/echo_api/dart/dio/built_value/doc/PizzaSpeziale.md
new file mode 100644
index 000000000000..483cc83e301b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/PizzaSpeziale.md
@@ -0,0 +1,20 @@
+# openapi.model.PizzaSpeziale
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**toppings** | **String** | | [optional]
+**href** | **String** | Hyperlink reference | [optional]
+**id** | **String** | unique identifier | [optional]
+**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional]
+**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional]
+**atType** | **String** | When sub-classing, this defines the sub-class Extensible name |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/ReadOnlyFirst.md b/samples/client/echo_api/dart/dio/built_value/doc/ReadOnlyFirst.md
new file mode 100644
index 000000000000..e21d61aa3f20
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/ReadOnlyFirst.md
@@ -0,0 +1,16 @@
+# openapi.model.ReadOnlyFirst
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional]
+**baz** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/SingleRefType.md b/samples/client/echo_api/dart/dio/built_value/doc/SingleRefType.md
new file mode 100644
index 000000000000..cbcf9ead7e6c
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/SingleRefType.md
@@ -0,0 +1,14 @@
+# openapi.model.SingleRefType
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/SpecialModelName.md b/samples/client/echo_api/dart/dio/built_value/doc/SpecialModelName.md
new file mode 100644
index 000000000000..8c22491d783c
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/SpecialModelName.md
@@ -0,0 +1,15 @@
+# openapi.model.SpecialModelName
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/StoreApi.md b/samples/client/echo_api/dart/dio/built_value/doc/StoreApi.md
new file mode 100644
index 000000000000..fdd353d4a164
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/StoreApi.md
@@ -0,0 +1,188 @@
+# openapi.api.StoreApi
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
+[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
+[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
+
+
+# **deleteOrder**
+> deleteOrder(orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getStoreApi();
+final String orderId = orderId_example; // String | ID of the order that needs to be deleted
+
+try {
+ api.deleteOrder(orderId);
+} catch on DioException (e) {
+ print('Exception when calling StoreApi->deleteOrder: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **String**| ID of the order that needs to be deleted |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **getInventory**
+> BuiltMap getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+// TODO Configure API key authorization: api_key
+//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY';
+// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer';
+
+final api = Openapi().getStoreApi();
+
+try {
+ final response = api.getInventory();
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling StoreApi->getInventory: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+**BuiltMap<String, int>**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **getOrderById**
+> Order getOrderById(orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getStoreApi();
+final int orderId = 789; // int | ID of pet that needs to be fetched
+
+try {
+ final response = api.getOrderById(orderId);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling StoreApi->getOrderById: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **int**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **placeOrder**
+> Order placeOrder(order)
+
+Place an order for a pet
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getStoreApi();
+final Order order = ; // Order | order placed for purchasing the pet
+
+try {
+ final response = api.placeOrder(order);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling StoreApi->placeOrder: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/Tag.md b/samples/client/echo_api/dart/dio/built_value/doc/Tag.md
new file mode 100644
index 000000000000..1c0ee4595a65
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/Tag.md
@@ -0,0 +1,16 @@
+# openapi.model.Tag
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**name** | **String** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/User.md b/samples/client/echo_api/dart/dio/built_value/doc/User.md
new file mode 100644
index 000000000000..c51ef002c6b2
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/User.md
@@ -0,0 +1,22 @@
+# openapi.model.User
+
+## Load the model package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**username** | **String** | | [optional]
+**firstName** | **String** | | [optional]
+**lastName** | **String** | | [optional]
+**email** | **String** | | [optional]
+**password** | **String** | | [optional]
+**phone** | **String** | | [optional]
+**userStatus** | **int** | User Status | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/doc/UserApi.md b/samples/client/echo_api/dart/dio/built_value/doc/UserApi.md
new file mode 100644
index 000000000000..ad6f4f2e951c
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/doc/UserApi.md
@@ -0,0 +1,359 @@
+# openapi.api.UserApi
+
+## Load the API package
+```dart
+import 'package:openapi/openapi.dart';
+```
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createUser**](UserApi.md#createuser) | **POST** /user | Create user
+[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
+[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
+[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
+[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
+[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
+[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
+[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
+
+
+# **createUser**
+> createUser(user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getUserApi();
+final User user = ; // User | Created user object
+
+try {
+ api.createUser(user);
+} catch on DioException (e) {
+ print('Exception when calling UserApi->createUser: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**User**](User.md)| Created user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **createUsersWithArrayInput**
+> createUsersWithArrayInput(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getUserApi();
+final BuiltList user = ; // BuiltList | List of user object
+
+try {
+ api.createUsersWithArrayInput(user);
+} catch on DioException (e) {
+ print('Exception when calling UserApi->createUsersWithArrayInput: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**BuiltList<User>**](User.md)| List of user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **createUsersWithListInput**
+> createUsersWithListInput(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getUserApi();
+final BuiltList user = ; // BuiltList | List of user object
+
+try {
+ api.createUsersWithListInput(user);
+} catch on DioException (e) {
+ print('Exception when calling UserApi->createUsersWithListInput: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**BuiltList<User>**](User.md)| List of user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **deleteUser**
+> deleteUser(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getUserApi();
+final String username = username_example; // String | The name that needs to be deleted
+
+try {
+ api.deleteUser(username);
+} catch on DioException (e) {
+ print('Exception when calling UserApi->deleteUser: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be deleted |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **getUserByName**
+> User getUserByName(username)
+
+Get user by user name
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getUserApi();
+final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
+
+try {
+ final response = api.getUserByName(username);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling UserApi->getUserByName: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **loginUser**
+> String loginUser(username, password)
+
+Logs user into the system
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getUserApi();
+final String username = username_example; // String | The user name for login
+final String password = password_example; // String | The password for login in clear text
+
+try {
+ final response = api.loginUser(username, password);
+ print(response);
+} catch on DioException (e) {
+ print('Exception when calling UserApi->loginUser: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **logoutUser**
+> logoutUser()
+
+Logs out current logged in user session
+
+
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getUserApi();
+
+try {
+ api.logoutUser();
+} catch on DioException (e) {
+ print('Exception when calling UserApi->logoutUser: $e\n');
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **updateUser**
+> updateUser(username, user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+```dart
+import 'package:openapi/openapi.dart';
+
+final api = Openapi().getUserApi();
+final String username = username_example; // String | name that need to be deleted
+final User user = ; // User | Updated user object
+
+try {
+ api.updateUser(username, user);
+} catch on DioException (e) {
+ print('Exception when calling UserApi->updateUser: $e\n');
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| name that need to be deleted |
+ **user** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/client/echo_api/dart/dio/built_value/lib/apis.dart b/samples/client/echo_api/dart/dio/built_value/lib/apis.dart
new file mode 100644
index 000000000000..4facc7ca3861
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/lib/apis.dart
@@ -0,0 +1,10 @@
+export 'package:openapi/src/api_client.dart';
+export 'package:openapi/src/api/another_fake_api.dart';
+export 'package:openapi/src/api/bar_api.dart';
+export 'package:openapi/src/api/default_api.dart';
+export 'package:openapi/src/api/fake_api.dart';
+export 'package:openapi/src/api/fake_classname_tags123_api.dart';
+export 'package:openapi/src/api/foo_api.dart';
+export 'package:openapi/src/api/pet_api.dart';
+export 'package:openapi/src/api/store_api.dart';
+export 'package:openapi/src/api/user_api.dart';
diff --git a/samples/client/echo_api/dart/dio/built_value/lib/models.dart b/samples/client/echo_api/dart/dio/built_value/lib/models.dart
new file mode 100644
index 000000000000..16d6bf568fe1
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/lib/models.dart
@@ -0,0 +1,105 @@
+export 'package:openapi/src/serializers.dart';
+export 'package:openapi/src/date_serializer.dart';
+export 'package:openapi/src/model/date.dart';
+export 'package:openapi/src/repository_base.dart';
+export 'package:openapi/src/repository_impl.dart';
+export 'package:openapi/src/model/additional_properties_class.dart';
+export 'package:openapi/src/model/addressable.dart';
+export 'package:openapi/src/model/all_of_with_single_ref.dart';
+export 'package:openapi/src/model/animal.dart';
+export 'package:openapi/src/model/api_response.dart';
+export 'package:openapi/src/model/apple.dart';
+export 'package:openapi/src/model/apple_all_of_disc.dart';
+export 'package:openapi/src/model/apple_grandparent_disc.dart';
+export 'package:openapi/src/model/apple_one_of_disc.dart';
+export 'package:openapi/src/model/apple_req_disc.dart';
+export 'package:openapi/src/model/apple_variant1.dart';
+export 'package:openapi/src/model/array_of_array_of_number_only.dart';
+export 'package:openapi/src/model/array_of_number_only.dart';
+export 'package:openapi/src/model/array_test.dart';
+export 'package:openapi/src/model/banana.dart';
+export 'package:openapi/src/model/banana_all_of_disc.dart';
+export 'package:openapi/src/model/banana_grandparent_disc.dart';
+export 'package:openapi/src/model/banana_one_of_disc.dart';
+export 'package:openapi/src/model/banana_req_disc.dart';
+export 'package:openapi/src/model/bar.dart';
+export 'package:openapi/src/model/bar_create.dart';
+export 'package:openapi/src/model/bar_ref.dart';
+export 'package:openapi/src/model/bar_ref_or_value.dart';
+export 'package:openapi/src/model/capitalization.dart';
+export 'package:openapi/src/model/cat.dart';
+export 'package:openapi/src/model/category.dart';
+export 'package:openapi/src/model/class_model.dart';
+export 'package:openapi/src/model/composed_disc_missing_from_properties.dart';
+export 'package:openapi/src/model/composed_disc_optional_type_correct.dart';
+export 'package:openapi/src/model/composed_disc_optional_type_inconsistent.dart';
+export 'package:openapi/src/model/composed_disc_optional_type_incorrect.dart';
+export 'package:openapi/src/model/composed_disc_required_inconsistent.dart';
+export 'package:openapi/src/model/composed_disc_type_inconsistent.dart';
+export 'package:openapi/src/model/composed_disc_type_incorrect.dart';
+export 'package:openapi/src/model/deprecated_object.dart';
+export 'package:openapi/src/model/disc_missing_from_properties.dart';
+export 'package:openapi/src/model/disc_optional_type_correct.dart';
+export 'package:openapi/src/model/disc_optional_type_incorrect.dart';
+export 'package:openapi/src/model/disc_type_incorrect.dart';
+export 'package:openapi/src/model/dog.dart';
+export 'package:openapi/src/model/entity.dart';
+export 'package:openapi/src/model/entity_ref.dart';
+export 'package:openapi/src/model/enum_arrays.dart';
+export 'package:openapi/src/model/enum_test.dart';
+export 'package:openapi/src/model/extensible.dart';
+export 'package:openapi/src/model/file_schema_test_class.dart';
+export 'package:openapi/src/model/foo.dart';
+export 'package:openapi/src/model/foo_basic_get_default_response.dart';
+export 'package:openapi/src/model/foo_ref.dart';
+export 'package:openapi/src/model/foo_ref_or_value.dart';
+export 'package:openapi/src/model/format_test.dart';
+export 'package:openapi/src/model/fruit.dart';
+export 'package:openapi/src/model/fruit_all_of_disc.dart';
+export 'package:openapi/src/model/fruit_any_of_disc.dart';
+export 'package:openapi/src/model/fruit_grandparent_disc.dart';
+export 'package:openapi/src/model/fruit_inline_disc.dart';
+export 'package:openapi/src/model/fruit_inline_disc_one_of.dart';
+export 'package:openapi/src/model/fruit_inline_disc_one_of1.dart';
+export 'package:openapi/src/model/fruit_inline_inline_disc.dart';
+export 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart';
+export 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart';
+export 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart';
+export 'package:openapi/src/model/fruit_one_of_disc.dart';
+export 'package:openapi/src/model/fruit_req_disc.dart';
+export 'package:openapi/src/model/fruit_type.dart';
+export 'package:openapi/src/model/fruit_variant1.dart';
+export 'package:openapi/src/model/giga_one_of.dart';
+export 'package:openapi/src/model/grape_variant1.dart';
+export 'package:openapi/src/model/has_only_read_only.dart';
+export 'package:openapi/src/model/health_check_result.dart';
+export 'package:openapi/src/model/map_test.dart';
+export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart';
+export 'package:openapi/src/model/model200_response.dart';
+export 'package:openapi/src/model/model_client.dart';
+export 'package:openapi/src/model/model_enum_class.dart';
+export 'package:openapi/src/model/model_file.dart';
+export 'package:openapi/src/model/model_list.dart';
+export 'package:openapi/src/model/model_return.dart';
+export 'package:openapi/src/model/name.dart';
+export 'package:openapi/src/model/nullable_class.dart';
+export 'package:openapi/src/model/number_only.dart';
+export 'package:openapi/src/model/object_with_deprecated_fields.dart';
+export 'package:openapi/src/model/one_of_primitive_child.dart';
+export 'package:openapi/src/model/order.dart';
+export 'package:openapi/src/model/outer_composite.dart';
+export 'package:openapi/src/model/outer_enum.dart';
+export 'package:openapi/src/model/outer_enum_default_value.dart';
+export 'package:openapi/src/model/outer_enum_integer.dart';
+export 'package:openapi/src/model/outer_enum_integer_default_value.dart';
+export 'package:openapi/src/model/outer_object_with_enum_property.dart';
+export 'package:openapi/src/model/parent.dart';
+export 'package:openapi/src/model/pasta.dart';
+export 'package:openapi/src/model/pet.dart';
+export 'package:openapi/src/model/pizza.dart';
+export 'package:openapi/src/model/pizza_speziale.dart';
+export 'package:openapi/src/model/read_only_first.dart';
+export 'package:openapi/src/model/single_ref_type.dart';
+export 'package:openapi/src/model/special_model_name.dart';
+export 'package:openapi/src/model/tag.dart';
+export 'package:openapi/src/model/user.dart';
diff --git a/samples/client/echo_api/dart/dio/built_value/lib/openapi.dart b/samples/client/echo_api/dart/dio/built_value/lib/openapi.dart
new file mode 100644
index 000000000000..6c3dbb746aa8
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/lib/openapi.dart
@@ -0,0 +1,8 @@
+//
+// AUTO-GENERATED FILE, DO NOT MODIFY!
+//
+
+
+export 'apis.dart';
+export 'models.dart';
+export 'package:openapi/src/auth/_exports.dart';
diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart
new file mode 100644
index 000000000000..6df08905607b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart
@@ -0,0 +1,162 @@
+//
+// AUTO-GENERATED FILE, DO NOT MODIFY!
+//
+
+import 'dart:async';
+import 'package:dio/dio.dart';
+import 'package:built_value/built_value.dart';
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/serializer.dart';
+import 'package:openapi/src/repository_base.dart';
+import 'package:openapi/src/api_util.dart';
+import 'package:openapi/models.dart';
+import 'package:openapi/src/model/model_client.dart';
+
+
+class AnotherFakeApi {
+
+ final AnotherFakeApiRaw rawApi;
+ final SerializationRepositoryBase _repository;
+
+ const AnotherFakeApi(this.rawApi, this._repository);
+
+ /// To test special tags
+ /// To test special tags and operation ID starting with number
+ ///
+ /// Parameters:
+ /// * [modelClient] - client model
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future] containing a [Response] with a [ModelClient] as data
+ /// Throws [DioException] if API call or serialization fails
+ Future> call123testSpecialTags({
+ required ModelClient modelClient,
+ CancelToken? cancelToken,
+ Map? headers,
+ Map? extra,
+ ValidateStatus? validateStatus,
+ ProgressCallback? onSendProgress,
+ ProgressCallback? onReceiveProgress,
+ }) async {
+ Object? _bodyData;
+ _bodyData = await encodeBodyParameter(_repository, modelClient, const TypeInfo(
+
+
+ ModelClient
+ )
+
+);
+
+ final _response = await rawApi.call123testSpecialTags(
+
+ body: _bodyData,
+ requestContentType: 'application/json',
+ cancelToken: cancelToken,
+ headers: headers,
+ extra: extra,
+ validateStatus: validateStatus,
+ onSendProgress: onSendProgress,
+ onReceiveProgress: onReceiveProgress,
+ );
+
+ ModelClient? _responseData;
+
+ try {
+ final rawResponse = _response.data;
+ _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo(
+
+ ModelClient
+
+ )
+
+);
+ } catch (error, stackTrace) {
+ throw DioException(
+ requestOptions: _response.requestOptions,
+ response: _response,
+ type: DioExceptionType.unknown,
+ error: error,
+ stackTrace: stackTrace,
+ );
+ }
+
+ return Response(
+ data: _responseData,
+ headers: _response.headers,
+ isRedirect: _response.isRedirect,
+ requestOptions: _response.requestOptions,
+ redirects: _response.redirects,
+ statusCode: _response.statusCode,
+ statusMessage: _response.statusMessage,
+ extra: _response.extra,
+ );
+ }
+
+}
+class AnotherFakeApiRaw {
+
+ final Dio _dio;
+
+ const AnotherFakeApiRaw(this._dio);
+
+ /// To test special tags
+ /// To test special tags and operation ID starting with number
+ ///
+ /// Parameters:
+ /// * [modelClient] - client model
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future] containing a [Response] with a [ModelClient] as data
+ /// Throws [DioException] if API call or serialization fails
+ Future> call123testSpecialTags({
+ Object? body,
+ String? requestContentType,
+ String? acceptContentType,
+ ResponseType? responseType,
+ CancelToken? cancelToken,
+ Map? headers,
+ Map? extra,
+ ValidateStatus? validateStatus,
+ ProgressCallback? onSendProgress,
+ ProgressCallback? onReceiveProgress,
+ }) async {
+ final _path = r'/another-fake/dummy';
+ final _options = Options(
+ method: r'PATCH',
+ headers: {
+ if (acceptContentType != null) 'Accept': acceptContentType,
+ ...?headers,
+ },
+ extra: {
+ 'secure': >[],
+ ...?extra,
+ },
+ contentType: requestContentType,
+ responseType: responseType,
+ validateStatus: validateStatus,
+ );
+
+ return await _dio.request(
+ _path,
+ data: body,
+ options: _options,
+ cancelToken: cancelToken,
+ onSendProgress: onSendProgress,
+ onReceiveProgress: onReceiveProgress,
+ );
+ }
+
+}
+
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart
new file mode 100644
index 000000000000..4de07ba6196b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart
@@ -0,0 +1,163 @@
+//
+// AUTO-GENERATED FILE, DO NOT MODIFY!
+//
+
+import 'dart:async';
+import 'package:dio/dio.dart';
+import 'package:built_value/built_value.dart';
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/serializer.dart';
+import 'package:openapi/src/repository_base.dart';
+import 'package:openapi/src/api_util.dart';
+import 'package:openapi/models.dart';
+import 'package:openapi/src/model/bar.dart';
+import 'package:openapi/src/model/bar_create.dart';
+
+
+class BarApi {
+
+ final BarApiRaw rawApi;
+ final SerializationRepositoryBase _repository;
+
+ const BarApi(this.rawApi, this._repository);
+
+ /// Create a Bar
+ ///
+ ///
+ /// Parameters:
+ /// * [barCreate]
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future] containing a [Response] with a [Bar] as data
+ /// Throws [DioException] if API call or serialization fails
+ Future> createBar({
+ required BarCreate barCreate,
+ CancelToken? cancelToken,
+ Map? headers,
+ Map? extra,
+ ValidateStatus? validateStatus,
+ ProgressCallback? onSendProgress,
+ ProgressCallback? onReceiveProgress,
+ }) async {
+ Object? _bodyData;
+ _bodyData = await encodeBodyParameter(_repository, barCreate, const TypeInfo(
+
+
+ BarCreate
+ )
+
+);
+
+ final _response = await rawApi.createBar(
+
+ body: _bodyData,
+ requestContentType: 'application/json',
+ cancelToken: cancelToken,
+ headers: headers,
+ extra: extra,
+ validateStatus: validateStatus,
+ onSendProgress: onSendProgress,
+ onReceiveProgress: onReceiveProgress,
+ );
+
+ Bar? _responseData;
+
+ try {
+ final rawResponse = _response.data;
+ _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo(
+
+ Bar
+
+ )
+
+);
+ } catch (error, stackTrace) {
+ throw DioException(
+ requestOptions: _response.requestOptions,
+ response: _response,
+ type: DioExceptionType.unknown,
+ error: error,
+ stackTrace: stackTrace,
+ );
+ }
+
+ return Response(
+ data: _responseData,
+ headers: _response.headers,
+ isRedirect: _response.isRedirect,
+ requestOptions: _response.requestOptions,
+ redirects: _response.redirects,
+ statusCode: _response.statusCode,
+ statusMessage: _response.statusMessage,
+ extra: _response.extra,
+ );
+ }
+
+}
+class BarApiRaw {
+
+ final Dio _dio;
+
+ const BarApiRaw(this._dio);
+
+ /// Create a Bar
+ ///
+ ///
+ /// Parameters:
+ /// * [barCreate]
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future] containing a [Response] with a [Bar] as data
+ /// Throws [DioException] if API call or serialization fails
+ Future> createBar({
+ Object? body,
+ String? requestContentType,
+ String? acceptContentType,
+ ResponseType? responseType,
+ CancelToken? cancelToken,
+ Map? headers,
+ Map? extra,
+ ValidateStatus? validateStatus,
+ ProgressCallback? onSendProgress,
+ ProgressCallback? onReceiveProgress,
+ }) async {
+ final _path = r'/bar';
+ final _options = Options(
+ method: r'POST',
+ headers: {
+ if (acceptContentType != null) 'Accept': acceptContentType,
+ ...?headers,
+ },
+ extra: {
+ 'secure': >[],
+ ...?extra,
+ },
+ contentType: requestContentType,
+ responseType: responseType,
+ validateStatus: validateStatus,
+ );
+
+ return await _dio.request(
+ _path,
+ data: body,
+ options: _options,
+ cancelToken: cancelToken,
+ onSendProgress: onSendProgress,
+ onReceiveProgress: onReceiveProgress,
+ );
+ }
+
+}
+
+
+
diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart
new file mode 100644
index 000000000000..a72f9758407b
--- /dev/null
+++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart
@@ -0,0 +1,722 @@
+//
+// AUTO-GENERATED FILE, DO NOT MODIFY!
+//
+
+import 'dart:async';
+import 'package:dio/dio.dart';
+import 'package:built_value/built_value.dart';
+import 'package:built_collection/built_collection.dart';
+import 'package:built_value/serializer.dart';
+import 'package:openapi/src/repository_base.dart';
+import 'package:openapi/src/api_util.dart';
+import 'package:openapi/models.dart';
+import 'package:built_value/json_object.dart';
+import 'package:openapi/src/model/foo_basic_get_default_response.dart';
+import 'package:openapi/src/model/fruit.dart';
+import 'package:openapi/src/model/fruit_all_of_disc.dart';
+import 'package:openapi/src/model/fruit_variant1.dart';
+import 'package:openapi/src/model/giga_one_of.dart';
+
+
+class DefaultApi {
+
+ final DefaultApiRaw rawApi;
+ final SerializationRepositoryBase _repository;
+
+ const DefaultApi(this.rawApi, this._repository);
+
+ /// fooBasicGet
+ ///
+ ///
+ /// Parameters:
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data
+ /// Throws [DioException] if API call or serialization fails
+ Future> fooBasicGet({
+ CancelToken? cancelToken,
+ Map? headers,
+ Map? extra,
+ ValidateStatus? validateStatus,
+ ProgressCallback? onSendProgress,
+ ProgressCallback? onReceiveProgress,
+ }) async {
+
+ final _response = await rawApi.fooBasicGet(
+
+
+ cancelToken: cancelToken,
+ headers: headers,
+ extra: extra,
+ validateStatus: validateStatus,
+ onSendProgress: onSendProgress,
+ onReceiveProgress: onReceiveProgress,
+ );
+
+ FooBasicGetDefaultResponse? _responseData;
+
+ try {
+ final rawResponse = _response.data;
+ _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo(
+
+ FooBasicGetDefaultResponse
+
+ )
+
+);
+ } catch (error, stackTrace) {
+ throw DioException(
+ requestOptions: _response.requestOptions,
+ response: _response,
+ type: DioExceptionType.unknown,
+ error: error,
+ stackTrace: stackTrace,
+ );
+ }
+
+ return Response(
+ data: _responseData,
+ headers: _response.headers,
+ isRedirect: _response.isRedirect,
+ requestOptions: _response.requestOptions,
+ redirects: _response.redirects,
+ statusCode: _response.statusCode,
+ statusMessage: _response.statusMessage,
+ extra: _response.extra,
+ );
+ }
+
+ /// list
+ ///
+ ///
+ /// Parameters:
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data
+ /// Throws [DioException] if API call or serialization fails
+ Future> list({
+ CancelToken? cancelToken,
+ Map? headers,
+ Map? extra,
+ ValidateStatus? validateStatus,
+ ProgressCallback? onSendProgress,
+ ProgressCallback? onReceiveProgress,
+ }) async {
+
+ final _response = await rawApi.list(
+
+
+ cancelToken: cancelToken,
+ headers: headers,
+ extra: extra,
+ validateStatus: validateStatus,
+ onSendProgress: onSendProgress,
+ onReceiveProgress: onReceiveProgress,
+ );
+
+ GigaOneOf? _responseData;
+
+ try {
+ final rawResponse = _response.data;
+ _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo(
+
+ GigaOneOf
+
+ )
+
+);
+ } catch (error, stackTrace) {
+ throw DioException(
+ requestOptions: _response.requestOptions,
+ response: _response,
+ type: DioExceptionType.unknown,
+ error: error,
+ stackTrace: stackTrace,
+ );
+ }
+
+ return Response(
+ data: _responseData,
+ headers: _response.headers,
+ isRedirect: _response.isRedirect,
+ requestOptions: _response.requestOptions,
+ redirects: _response.redirects,
+ statusCode: _response.statusCode,
+ statusMessage: _response.statusMessage,
+ extra: _response.extra,
+ );
+ }
+
+ /// oneofGet
+ ///
+ ///
+ /// Parameters:
+ /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
+ /// * [headers] - Can be used to add additional headers to the request
+ /// * [extras] - Can be used to add flags to the request
+ /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
+ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
+ /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
+ ///
+ /// Returns a [Future] containing a [Response] with a [Fruit] as data
+ /// Throws [DioException] if API call or serialization fails
+ Future