docs/generators
dart-dio.md +2 -1
modules/openapi-generator/src
main
java/org/openapitools/codegen
languages
DartClientCodegen.java +1 -1
DartDioClientCodegen.java +75 -35
CodegenOperation.java +9 -0
resources/dart-dio
api.mustache +78 -49
test/java/org/openapitools/codegen
dartdio
DartDioClientOptionsTest.java +7 -5
DartDioModelTest.java +2 -10
options
DartDioClientOptionsProvider.java +3 -4
samples
client/petstore/dart-dio/…/lib/api
pet_api.dart +104 -44
store_api.dart +55 -26
user_api.dart +66 -26
openapi3/client/petstore/dart-dio
petstore_client_lib/lib/api
pet_api.dart +134 -54
store_api.dart +55 -26
user_api.dart +66 -26
petstore_client_lib_fake/lib/api
another_fake_api.dart +25 -7
default_api.dart +15 -8
fake_api.dart +213 -66
fake_classname_tags123_api.dart +25 -7
pet_api.dart +131 -53
store_api.dart +55 -26
user_api.dart +66 -26
+ 2
- 1
@@ -9,10 +9,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
@@ -9,10 +9,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|dateLibrary|Option. Date library to use|<dl><dt>**core**</dt><dd>Dart core library (DateTime)</dd><dt>**timemachine**</dt><dd>Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.</dd></dl>|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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|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.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>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.</dd></dl>|true|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>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.</dd></dl>|true|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
+ 1
- 1
@@ -54,7 +54,7 @@ public class DartClientCodegen extends AbstractDartCodegen {
@@ -54,7 +54,7 @@ public class DartClientCodegen extends AbstractDartCodegen {
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java
+ 75
- 35
@@ -37,12 +37,22 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -37,12 +37,22 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -50,13 +60,17 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -50,13 +60,17 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use").defaultValue(this.getDateLibrary());
dateOptions.put("timemachine", "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.");
@@ -94,7 +108,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -94,7 +108,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -102,6 +116,22 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -102,6 +116,22 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -157,23 +187,25 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -157,23 +187,25 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
additionalProperties.put(CLIENT_NAME, org.openapitools.codegen.utils.StringUtils.camelize(pubName));
@@ -192,19 +224,27 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
@@ -192,19 +224,27 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
supportingFiles.add(new SupportingFile("local_date_serializer.mustache", libFolder, "local_date_serializer.dart"));
@@ -78,6 +78,15 @@ public class CodegenOperation {
@@ -78,6 +78,15 @@ public class CodegenOperation {
@@ -71,64 +71,93 @@ class {{classname}} {
@@ -71,64 +71,93 @@ class {{classname}} {
{{^required}}{{^nullable}}if ({{{paramName}}} != null) {{/nullable}}{{/required}}r'{{{baseName}}}': {{#isFile}}MultipartFile.fromBytes({{{paramName}}}, filename: r'{{{baseName}}}'){{/isFile}}{{^isFile}}parameterToString(_serializers, {{{paramName}}}){{/isFile}},
const _type = FullType(Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]);
const _responseType = FullType(Built{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}{{#isMap}}Map{{/isMap}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{returnBaseType}}})]);