From f484e0db421e428d6e2c1020366963bf81d63ebe Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Tue, 15 Dec 2020 02:55:33 +0100 Subject: [PATCH] [dart][dart-dio] Formatting improvements (#8180) * always add trailing commas in arrays and break each line * make variables final * improve API formatting (mainly leading spaces) * remove empty lines and whitespaces * fix formatting of datatype and description and docs * consistently use single quotation marks (dart already does this) --- .../src/main/resources/dart-dio/api.mustache | 82 +- .../main/resources/dart-dio/api_doc.mustache | 6 +- .../main/resources/dart-dio/apilib.mustache | 2 +- .../main/resources/dart-dio/class.mustache | 10 +- .../dart-dio/local_date_serializer.mustache | 4 +- .../resources/dart-dio/object_doc.mustache | 2 +- .../src/main/resources/dart2/class.mustache | 4 +- .../dart-dio/petstore_client_lib/doc/Pet.md | 4 +- .../petstore_client_lib/doc/PetApi.md | 20 +- .../petstore_client_lib/doc/StoreApi.md | 8 +- .../petstore_client_lib/doc/UserApi.md | 24 +- .../dart-dio/petstore_client_lib/lib/api.dart | 2 +- .../petstore_client_lib/lib/api/pet_api.dart | 424 +++++---- .../lib/api/store_api.dart | 193 +++-- .../petstore_client_lib/lib/api/user_api.dart | 376 ++++---- .../lib/model/api_response.dart | 5 +- .../lib/model/category.dart | 3 +- .../petstore_client_lib/lib/model/order.dart | 12 +- .../petstore_client_lib/lib/model/pet.dart | 12 +- .../petstore_client_lib/lib/model/tag.dart | 3 +- .../petstore_client_lib/lib/model/user.dart | 16 +- .../lib/model/api_response.dart | 3 - .../lib/model/category.dart | 2 - .../petstore_client_lib/lib/model/order.dart | 5 - .../petstore_client_lib/lib/model/pet.dart | 5 - .../petstore_client_lib/lib/model/tag.dart | 2 - .../petstore_client_lib/lib/model/user.dart | 7 - .../dart-dio/petstore_client_lib/doc/Pet.md | 4 +- .../petstore_client_lib/doc/PetApi.md | 20 +- .../petstore_client_lib/doc/StoreApi.md | 8 +- .../petstore_client_lib/doc/UserApi.md | 24 +- .../dart-dio/petstore_client_lib/lib/api.dart | 2 +- .../petstore_client_lib/lib/api/pet_api.dart | 430 ++++++---- .../lib/api/store_api.dart | 195 +++-- .../petstore_client_lib/lib/api/user_api.dart | 426 +++++---- .../lib/model/api_response.dart | 5 +- .../lib/model/category.dart | 3 +- .../lib/model/inline_object.dart | 5 +- .../lib/model/inline_object1.dart | 5 +- .../petstore_client_lib/lib/model/order.dart | 12 +- .../petstore_client_lib/lib/model/pet.dart | 12 +- .../petstore_client_lib/lib/model/tag.dart | 3 +- .../petstore_client_lib/lib/model/user.dart | 16 +- .../doc/AdditionalPropertiesClass.md | 4 +- .../doc/AnotherFakeApi.md | 2 +- .../doc/ArrayOfArrayOfNumberOnly.md | 2 +- .../doc/ArrayOfNumberOnly.md | 2 +- .../petstore_client_lib_fake/doc/ArrayTest.md | 6 +- .../doc/DefaultApi.md | 2 +- .../doc/EnumArrays.md | 2 +- .../petstore_client_lib_fake/doc/FakeApi.md | 56 +- .../doc/FakeClassnameTags123Api.md | 2 +- .../doc/FileSchemaTestClass.md | 2 +- .../doc/FormatTest.md | 2 +- .../doc/InlineObject2.md | 2 +- .../petstore_client_lib_fake/doc/MapTest.md | 8 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../doc/NullableClass.md | 12 +- .../petstore_client_lib_fake/doc/Pet.md | 4 +- .../petstore_client_lib_fake/doc/PetApi.md | 22 +- .../petstore_client_lib_fake/doc/StoreApi.md | 8 +- .../petstore_client_lib_fake/doc/UserApi.md | 24 +- .../petstore_client_lib_fake/lib/api.dart | 2 +- .../lib/api/another_fake_api.dart | 57 +- .../lib/api/default_api.dart | 49 +- .../lib/api/fake_api.dart | 807 ++++++++++-------- .../lib/api/fake_classname_tags123_api.dart | 64 +- .../lib/api/pet_api.dart | 477 +++++++---- .../lib/api/store_api.dart | 195 +++-- .../lib/api/user_api.dart | 384 +++++---- .../model/additional_properties_class.dart | 3 +- .../lib/model/animal.dart | 3 +- .../lib/model/api_response.dart | 5 +- .../model/array_of_array_of_number_only.dart | 1 - .../lib/model/array_of_number_only.dart | 1 - .../lib/model/array_test.dart | 5 +- .../lib/model/capitalization.dart | 12 +- .../lib/model/cat.dart | 5 +- .../lib/model/cat_all_of.dart | 1 - .../lib/model/category.dart | 3 +- .../lib/model/class_model.dart | 1 - .../lib/model/client.dart | 1 - .../lib/model/dog.dart | 5 +- .../lib/model/dog_all_of.dart | 1 - .../lib/model/enum_arrays.dart | 5 +- .../lib/model/enum_test.dart | 15 +- .../lib/model/file.dart | 2 +- .../lib/model/file_schema_test_class.dart | 3 +- .../lib/model/foo.dart | 1 - .../lib/model/format_test.dart | 33 +- .../lib/model/has_only_read_only.dart | 3 +- .../lib/model/health_check_result.dart | 1 - .../lib/model/inline_object.dart | 5 +- .../lib/model/inline_object1.dart | 5 +- .../lib/model/inline_object2.dart | 7 +- .../lib/model/inline_object3.dart | 41 +- .../lib/model/inline_object4.dart | 5 +- .../lib/model/inline_object5.dart | 5 +- .../lib/model/inline_response_default.dart | 1 - .../lib/model/map_test.dart | 7 +- ...rties_and_additional_properties_class.dart | 5 +- .../lib/model/model200_response.dart | 3 +- .../lib/model/model_return.dart | 1 - .../lib/model/name.dart | 7 +- .../lib/model/nullable_class.dart | 23 +- .../lib/model/number_only.dart | 1 - .../lib/model/order.dart | 12 +- .../lib/model/outer_composite.dart | 5 +- .../lib/model/pet.dart | 12 +- .../lib/model/read_only_first.dart | 3 +- .../lib/model/special_model_name.dart | 1 - .../lib/model/tag.dart | 3 +- .../lib/model/user.dart | 16 +- .../lib/model/api_response.dart | 3 - .../lib/model/category.dart | 2 - .../petstore_client_lib/lib/model/order.dart | 5 - .../petstore_client_lib/lib/model/pet.dart | 5 - .../petstore_client_lib/lib/model/tag.dart | 2 - .../petstore_client_lib/lib/model/user.dart | 7 - .../model/additional_properties_class.dart | 2 - .../lib/model/animal.dart | 2 - .../lib/model/api_response.dart | 3 - .../model/array_of_array_of_number_only.dart | 1 - .../lib/model/array_of_number_only.dart | 1 - .../lib/model/array_test.dart | 3 - .../lib/model/capitalization.dart | 5 - .../lib/model/cat.dart | 3 - .../lib/model/cat_all_of.dart | 1 - .../lib/model/category.dart | 2 - .../lib/model/class_model.dart | 1 - .../lib/model/client.dart | 1 - .../lib/model/dog.dart | 3 - .../lib/model/dog_all_of.dart | 1 - .../lib/model/enum_arrays.dart | 2 - .../lib/model/enum_test.dart | 8 - .../lib/model/file_schema_test_class.dart | 2 - .../lib/model/foo.dart | 1 - .../lib/model/format_test.dart | 14 - .../lib/model/has_only_read_only.dart | 2 - .../lib/model/health_check_result.dart | 1 - .../lib/model/inline_response_default.dart | 1 - .../lib/model/map_test.dart | 4 - ...rties_and_additional_properties_class.dart | 3 - .../lib/model/model200_response.dart | 2 - .../lib/model/model_return.dart | 1 - .../lib/model/name.dart | 4 - .../lib/model/nullable_class.dart | 12 - .../lib/model/number_only.dart | 1 - .../lib/model/order.dart | 5 - .../lib/model/outer_composite.dart | 3 - .../lib/model/pet.dart | 5 - .../lib/model/read_only_first.dart | 2 - .../lib/model/special_model_name.dart | 1 - .../lib/model/tag.dart | 2 - .../lib/model/user.dart | 7 - 155 files changed, 2756 insertions(+), 2263 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache index 9a4cc29beb3..1f2a044adc9 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -17,29 +16,37 @@ class {{classname}} { {{classname}}(this._dio, this._serializers); {{#operation}} - /// {{summary}} - /// - /// {{notes}} - Future{{/returnType}}>{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// {{{summary}}} + /// + /// {{{notes}}} + Future{{/returnType}}>{{nickname}}({{^hasRequiredParams}}{ {{/hasRequiredParams}}{{#requiredParams}} + {{{dataType}}} {{paramName}},{{#-last}} { {{/-last}}{{/requiredParams}}{{#optionalParams}} + {{{dataType}}} {{paramName}},{{/optionalParams}} + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{baseName}}' '}', {{{paramName}}}.toString()){{/pathParams}}; - String _path = "{{{path}}}"{{#pathParams}}.replaceAll("{" r'{{baseName}}' "}", {{{paramName}}}.toString()){{/pathParams}}; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; {{#headerParams}} - headerParams[r'{{baseName}}'] = {{paramName}}; + headerParams[r'{{baseName}}'] = {{paramName}}; {{/headerParams}} {{#queryParams}} - queryParams[r'{{baseName}}'] = {{paramName}}; + queryParams[r'{{baseName}}'] = {{paramName}}; {{/queryParams}} queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = [{{#consumes}}"{{{mediaType}}}"{{^-last}},{{/-last}}{{/consumes}}]; - + final List contentTypes = [{{^hasConsumes}}];{{/hasConsumes}}{{#hasConsumes}}{{#consumes}} + '{{{mediaType}}}',{{/consumes}} + ];{{/hasConsumes}} {{#hasFormParams}} + final Map formData = {}; {{#isMultipart}} {{#formParams}} @@ -63,39 +70,45 @@ class {{classname}} { bodyData = formData; {{/isMultipart}} {{/hasFormParams}} - {{#bodyParam}} + {{#isArray}} - const type = FullType(BuiltList, [FullType({{baseType}})]); - final serializedBody = _serializers.serialize({{paramName}}, specifiedType: type); + const type = FullType(BuiltList, [FullType({{baseType}})]); + final serializedBody = _serializers.serialize({{paramName}}, specifiedType: type); {{/isArray}} {{^isArray}} - final serializedBody = _serializers.serialize({{paramName}}); + final serializedBody = _serializers.serialize({{paramName}}); {{/isArray}} - final json{{paramName}} = json.encode(serializedBody); - bodyData = json{{paramName}}; + final json{{paramName}} = json.encode(serializedBody); + bodyData = json{{paramName}}; {{/bodyParam}} - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: '{{httpMethod}}'.toUpperCase(), - {{#isResponseFile}} - responseType: ResponseType.bytes, - {{/isResponseFile}} - headers: headerParams, - extra: { - 'secure': [{{#authMethods}} {"type": "{{type}}", "name": "{{name}}"{{#isApiKey}}, "keyName": "{{keyParamName}}", "where": "{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}"{{/isApiKey}} }{{^-last}}, {{/-last}}{{/authMethods}}], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: '{{httpMethod}}'.toUpperCase(), + {{#isResponseFile}} + responseType: ResponseType.bytes, + {{/isResponseFile}} + headers: headerParams, + extra: { + 'secure': [{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} + {{#authMethods}}{ + 'type': '{{type}}', + 'name': '{{name}}',{{#isApiKey}} + 'keyName': '{{keyParamName}}', + 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} + },{{/authMethods}} + ],{{/hasAuthMethods}} + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ){{#returnType}}.then((response) { - + ){{#returnType}}.then((response) { {{#isResponseFile}} final data = response.data; {{/isResponseFile}} @@ -125,8 +138,9 @@ class {{classname}} { statusMessage: response.statusMessage, extra: response.extra, ); - }){{/returnType}}; - } + }){{/returnType}}; + } + {{/operation}} - } +} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache index e38247ed5b2..cbaa61b75dd 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache @@ -47,7 +47,7 @@ import 'package:{{pubName}}/api.dart'; var api_instance = new {{classname}}(); {{#allParams}} -var {{paramName}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} +var {{paramName}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}new {{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { @@ -56,7 +56,7 @@ try { print(result); {{/returnType}} } catch (e) { - print("Exception when calling {{classname}}->{{operationId}}: $e\n"); + print('Exception when calling {{classname}}->{{operationId}}: $e\n'); } ``` @@ -64,7 +64,7 @@ try { {{^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}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart-dio/apilib.mustache b/modules/openapi-generator/src/main/resources/dart-dio/apilib.mustache index 685e63ef3be..1ad200a5a7b 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/apilib.mustache @@ -15,7 +15,7 @@ class {{clientName}} { Dio dio; Serializers serializers; - String basePath = "{{{basePath}}}"; + String basePath = '{{{basePath}}}'; {{clientName}}({this.dio, Serializers serializers, String basePathOverride, List interceptors}) { if (dio == null) { diff --git a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache index 44ff2494ae7..14f3f10b55f 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache @@ -6,17 +6,19 @@ part '{{classFilename}}.g.dart'; abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builder> { {{#vars}} - {{#description}}/* {{{description}}} */{{/description}} + {{#description}} + /// {{{description}}} + {{/description}} {{#isNullable}} @nullable {{/isNullable}} @BuiltValueField(wireName: r'{{baseName}}') {{{datatypeWithEnum}}} get {{name}}; {{#allowableValues}} - {{#min}}// range from {{min}} to {{max}}{{/min}}//{{^min}} enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}} + // {{#min}}range from {{{min}}} to {{{max}}}{{/min}}{{^min}}enum {{name}}Enum { {{#values}} {{{.}}}, {{/values}} };{{/min}} {{/allowableValues}} -{{/vars}} +{{/vars}} // Boilerplate code needed to wire-up generated code {{classname}}._(); @@ -42,4 +44,4 @@ abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builde {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} -{{/vars}} \ No newline at end of file +{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/dart-dio/local_date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart-dio/local_date_serializer.mustache index 86a9eac68c2..21b52dc2bc2 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/local_date_serializer.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/local_date_serializer.mustache @@ -7,7 +7,7 @@ class OffsetDateSerializer implements PrimitiveSerializer { Iterable get types => BuiltList([OffsetDate]); @override - String get wireName => "OffsetDate"; + String get wireName => 'OffsetDate'; @override OffsetDate deserialize(Serializers serializers, Object serialized, @@ -28,7 +28,7 @@ class OffsetDateTimeSerializer implements PrimitiveSerializer { Iterable get types => BuiltList([OffsetDateTime]); @override - String get wireName => "OffsetDateTime"; + String get wireName => 'OffsetDateTime'; @override OffsetDateTime deserialize(Serializers serializers, Object serialized, diff --git a/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache index 657f84d8905..14d3cf2dda5 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{pubName}}/api.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}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/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) diff --git a/modules/openapi-generator/src/main/resources/dart2/class.mustache b/modules/openapi-generator/src/main/resources/dart2/class.mustache index 879b15d2fd8..4140eeb7136 100644 --- a/modules/openapi-generator/src/main/resources/dart2/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/class.mustache @@ -7,7 +7,9 @@ class {{{classname}}} { }); {{#vars}} - {{#description}}/// {{{description}}}{{/description}} + {{#description}} + /// {{{description}}} + {{/description}} {{^isEnum}} {{#minimum}} // minimum: {{{minimum}}} diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/doc/Pet.md b/samples/client/petstore/dart-dio/petstore_client_lib/doc/Pet.md index 619e45d1848..b7e9e9282a1 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/doc/Pet.md +++ b/samples/client/petstore/dart-dio/petstore_client_lib/doc/Pet.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **id** | **int** | | [optional] [default to null] **category** | [**Category**](Category.md) | | [optional] [default to null] **name** | **String** | | [default to null] -**photoUrls** | **BuiltList<String>** | | [default to const []] -**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []] +**photoUrls** | **BuiltList** | | [default to const []] +**tags** | [**BuiltList**](Tag.md) | | [optional] [default to const []] **status** | **String** | pet status in the store | [optional] [default to null] [[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/petstore/dart-dio/petstore_client_lib/doc/PetApi.md b/samples/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md index 47f6cef7a2d..a277a99936e 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md +++ b/samples/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md @@ -36,7 +36,7 @@ var body = new Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); } catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); + print('Exception when calling PetApi->addPet: $e\n'); } ``` @@ -79,7 +79,7 @@ var apiKey = apiKey_example; // String | try { api_instance.deletePet(petId, apiKey); } catch (e) { - print("Exception when calling PetApi->deletePet: $e\n"); + print('Exception when calling PetApi->deletePet: $e\n'); } ``` @@ -125,7 +125,7 @@ try { var result = api_instance.findPetsByStatus(status); print(result); } catch (e) { - print("Exception when calling PetApi->findPetsByStatus: $e\n"); + print('Exception when calling PetApi->findPetsByStatus: $e\n'); } ``` @@ -133,7 +133,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []] + **status** | [**BuiltList**](String.md)| Status values that need to be considered for filter | [default to const []] ### Return type @@ -170,7 +170,7 @@ try { var result = api_instance.findPetsByTags(tags); print(result); } catch (e) { - print("Exception when calling PetApi->findPetsByTags: $e\n"); + print('Exception when calling PetApi->findPetsByTags: $e\n'); } ``` @@ -178,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []] + **tags** | [**BuiltList**](String.md)| Tags to filter by | [default to const []] ### Return type @@ -217,7 +217,7 @@ try { var result = api_instance.getPetById(petId); print(result); } catch (e) { - print("Exception when calling PetApi->getPetById: $e\n"); + print('Exception when calling PetApi->getPetById: $e\n'); } ``` @@ -259,7 +259,7 @@ var body = new Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.updatePet(body); } catch (e) { - print("Exception when calling PetApi->updatePet: $e\n"); + print('Exception when calling PetApi->updatePet: $e\n'); } ``` @@ -303,7 +303,7 @@ var status = status_example; // String | Updated status of the pet try { api_instance.updatePetWithForm(petId, name, status); } catch (e) { - print("Exception when calling PetApi->updatePetWithForm: $e\n"); + print('Exception when calling PetApi->updatePetWithForm: $e\n'); } ``` @@ -350,7 +350,7 @@ try { var result = api_instance.uploadFile(petId, additionalMetadata, file); print(result); } catch (e) { - print("Exception when calling PetApi->uploadFile: $e\n"); + print('Exception when calling PetApi->uploadFile: $e\n'); } ``` diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md b/samples/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md index fac1bb187aa..39ef3bd3d85 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md +++ b/samples/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md @@ -32,7 +32,7 @@ var orderId = orderId_example; // String | ID of the order that needs to be dele try { api_instance.deleteOrder(orderId); } catch (e) { - print("Exception when calling StoreApi->deleteOrder: $e\n"); + print('Exception when calling StoreApi->deleteOrder: $e\n'); } ``` @@ -78,7 +78,7 @@ try { var result = api_instance.getInventory(); print(result); } catch (e) { - print("Exception when calling StoreApi->getInventory: $e\n"); + print('Exception when calling StoreApi->getInventory: $e\n'); } ``` @@ -118,7 +118,7 @@ try { var result = api_instance.getOrderById(orderId); print(result); } catch (e) { - print("Exception when calling StoreApi->getOrderById: $e\n"); + print('Exception when calling StoreApi->getOrderById: $e\n'); } ``` @@ -159,7 +159,7 @@ try { var result = api_instance.placeOrder(body); print(result); } catch (e) { - print("Exception when calling StoreApi->placeOrder: $e\n"); + print('Exception when calling StoreApi->placeOrder: $e\n'); } ``` diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md b/samples/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md index de14cb998df..3e8817e83d7 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md +++ b/samples/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md @@ -36,7 +36,7 @@ var body = new User(); // User | Created user object try { api_instance.createUser(body); } catch (e) { - print("Exception when calling UserApi->createUser: $e\n"); + print('Exception when calling UserApi->createUser: $e\n'); } ``` @@ -71,12 +71,12 @@ Creates list of users with given input array import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var body = [new BuiltList<User>()]; // BuiltList | List of user object +var body = [new BuiltList()]; // BuiltList | List of user object try { api_instance.createUsersWithArrayInput(body); } catch (e) { - print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); + print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); } ``` @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BuiltList<User>**](User.md)| List of user object | + **body** | [**BuiltList**](User.md)| List of user object | ### Return type @@ -111,12 +111,12 @@ Creates list of users with given input array import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var body = [new BuiltList<User>()]; // BuiltList | List of user object +var body = [new BuiltList()]; // BuiltList | List of user object try { api_instance.createUsersWithListInput(body); } catch (e) { - print("Exception when calling UserApi->createUsersWithListInput: $e\n"); + print('Exception when calling UserApi->createUsersWithListInput: $e\n'); } ``` @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**BuiltList<User>**](User.md)| List of user object | + **body** | [**BuiltList**](User.md)| List of user object | ### Return type @@ -158,7 +158,7 @@ var username = username_example; // String | The name that needs to be deleted try { api_instance.deleteUser(username); } catch (e) { - print("Exception when calling UserApi->deleteUser: $e\n"); + print('Exception when calling UserApi->deleteUser: $e\n'); } ``` @@ -199,7 +199,7 @@ try { var result = api_instance.getUserByName(username); print(result); } catch (e) { - print("Exception when calling UserApi->getUserByName: $e\n"); + print('Exception when calling UserApi->getUserByName: $e\n'); } ``` @@ -241,7 +241,7 @@ try { var result = api_instance.loginUser(username, password); print(result); } catch (e) { - print("Exception when calling UserApi->loginUser: $e\n"); + print('Exception when calling UserApi->loginUser: $e\n'); } ``` @@ -281,7 +281,7 @@ var api_instance = new UserApi(); try { api_instance.logoutUser(); } catch (e) { - print("Exception when calling UserApi->logoutUser: $e\n"); + print('Exception when calling UserApi->logoutUser: $e\n'); } ``` @@ -321,7 +321,7 @@ var body = new User(); // User | Updated user object try { api_instance.updateUser(username, body); } catch (e) { - print("Exception when calling UserApi->updateUser: $e\n"); + print('Exception when calling UserApi->updateUser: $e\n'); } ``` diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/api.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/api.dart index 5cca5eafdc6..fb9635ab642 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/api.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/api.dart @@ -17,7 +17,7 @@ class Openapi { Dio dio; Serializers serializers; - String basePath = "http://petstore.swagger.io/v2"; + String basePath = 'http://petstore.swagger.io/v2'; Openapi({this.dio, Serializers serializers, String basePathOverride, List interceptors}) { if (dio == null) { diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart index bf19ec00cdf..ee68e64c5d9 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -16,116 +15,146 @@ class PetApi { PetApi(this._dio, this._serializers); - /// Add a new pet to the store - /// - /// - FutureaddPet(Pet body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Add a new pet to the store + /// + /// + FutureaddPet( + Pet body, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet'; - String _path = "/pet"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json","application/xml"]; + final List contentTypes = [ + 'application/json', + 'application/xml', + ]; + final serializedBody = _serializers.serialize(body); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - final serializedBody = _serializers.serialize(body); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Deletes a pet - /// - /// - FuturedeletePet(int petId,{ String apiKey,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Deletes a pet + /// + /// + FuturedeletePet( + int petId, { + String apiKey, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - headerParams[r'api_key'] = apiKey; + headerParams[r'api_key'] = apiKey; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - Future>>findPetsByStatus(BuiltList status,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/findByStatus"; + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + Future>>findPetsByStatus( + BuiltList status, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/findByStatus'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'status'] = status; + queryParams[r'status'] = status; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltList; const type = FullType(collectionType, [FullType(Pet)]); final BuiltList data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -139,44 +168,52 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future>>findPetsByTags(BuiltList tags,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet/findByTags"; + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + Future>>findPetsByTags( + BuiltList tags, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/findByTags'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'tags'] = tags; + queryParams[r'tags'] = tags; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltList; const type = FullType(collectionType, [FullType(Pet)]); final BuiltList data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -190,43 +227,53 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Find pet by ID - /// - /// Returns a single pet - Future>getPetById(int petId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Find pet by ID + /// + /// Returns a single pet + Future>getPetById( + int petId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Pet); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -239,100 +286,137 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Update an existing pet - /// - /// - FutureupdatePet(Pet body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet"; + /// Update an existing pet + /// + /// + FutureupdatePet( + Pet body, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json","application/xml"]; + final List contentTypes = [ + 'application/json', + 'application/xml', + ]; + final serializedBody = _serializers.serialize(body); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - final serializedBody = _serializers.serialize(body); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Updates a pet in the store with form data - /// - /// - FutureupdatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Updates a pet in the store with form data + /// + /// + FutureupdatePetWithForm( + int petId, { + String name, + String status, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/x-www-form-urlencoded"]; + final List contentTypes = [ + 'application/x-www-form-urlencoded', + ]; final Map formData = {}; formData['name'] = parameterToString(_serializers, name); formData['status'] = parameterToString(_serializers, status); bodyData = formData; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// uploads an image - /// - /// - Future>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/{petId}/uploadImage".replaceAll("{" r'petId' "}", petId.toString()); + /// uploads an image + /// + /// + Future>uploadFile( + int petId, { + String additionalMetadata, + Uint8List file, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["multipart/form-data"]; + final List contentTypes = [ + 'multipart/form-data', + ]; final Map formData = {}; if (additionalMetadata != null) { @@ -343,24 +427,27 @@ class PetApi { } bodyData = FormData.fromMap(formData); - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(ApiResponse); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -373,6 +460,7 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart index d7ae685d211..e78254bcd1c 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -13,76 +12,88 @@ class StoreApi { StoreApi(this._dio, this._serializers); - /// Delete purchase order by ID - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - FuturedeleteOrder(String orderId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Delete purchase order by ID + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + FuturedeleteOrder( + String orderId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString()); - String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString()); - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - Future>>getInventory({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/store/inventory"; + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + Future>>getInventory({ + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/inventory'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltMap; const type = FullType(collectionType, [FullType(String), FullType(int)]); final BuiltMap data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -96,43 +107,46 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Find purchase order by ID - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future>getOrderById(int orderId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString()); + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + Future>getOrderById( + int orderId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Order); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -145,46 +159,50 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Place an order for a pet - /// - /// - Future>placeOrder(Order body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/store/order"; + /// Place an order for a pet + /// + /// + Future>placeOrder( + Order body, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; + final serializedBody = _serializers.serialize(body); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - final serializedBody = _serializers.serialize(body); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Order); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -197,6 +215,7 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart index 20406454ed8..d8cb6240a00 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -13,192 +12,213 @@ class UserApi { UserApi(this._dio, this._serializers); - /// Create user - /// - /// This can only be done by the logged in user. - FuturecreateUser(User body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Create user + /// + /// This can only be done by the logged in user. + FuturecreateUser( + User body, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user'; - String _path = "/user"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; + final serializedBody = _serializers.serialize(body); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - final serializedBody = _serializers.serialize(body); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Creates list of users with given input array - /// - /// - FuturecreateUsersWithArrayInput(BuiltList body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/createWithArray"; + /// Creates list of users with given input array + /// + /// + FuturecreateUsersWithArrayInput( + BuiltList body, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/createWithArray'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; + const type = FullType(BuiltList, [FullType(User)]); + final serializedBody = _serializers.serialize(body, specifiedType: type); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - const type = FullType(BuiltList, [FullType(User)]); - final serializedBody = _serializers.serialize(body, specifiedType: type); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Creates list of users with given input array - /// - /// - FuturecreateUsersWithListInput(BuiltList body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/createWithList"; + /// Creates list of users with given input array + /// + /// + FuturecreateUsersWithListInput( + BuiltList body, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/createWithList'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; + const type = FullType(BuiltList, [FullType(User)]); + final serializedBody = _serializers.serialize(body, specifiedType: type); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - const type = FullType(BuiltList, [FullType(User)]); - final serializedBody = _serializers.serialize(body, specifiedType: type); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Delete user - /// - /// This can only be done by the logged in user. - FuturedeleteUser(String username,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Delete user + /// + /// This can only be done by the logged in user. + FuturedeleteUser( + String username, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Get user by user name - /// - /// - Future>getUserByName(String username,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Get user by user name + /// + /// + Future>getUserByName( + String username, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(User); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -211,45 +231,49 @@ class UserApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Logs user into the system - /// - /// - Future>loginUser(String username,String password,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/user/login"; + /// Logs user into the system + /// + /// + Future>loginUser( + String username, + String password, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/login'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'username'] = username; - queryParams[r'password'] = password; + queryParams[r'username'] = username; + queryParams[r'password'] = password; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final data = response.data as String; return Response( @@ -261,79 +285,89 @@ class UserApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Logs out current logged in user session - /// - /// - FuturelogoutUser({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/user/logout"; + /// Logs out current logged in user session + /// + /// + FuturelogoutUser({ + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/logout'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Updated user - /// - /// This can only be done by the logged in user. - FutureupdateUser(String username,User body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Updated user + /// + /// This can only be done by the logged in user. + FutureupdateUser( + String username, + User body, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; + final serializedBody = _serializers.serialize(body); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - final serializedBody = _serializers.serialize(body); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - } + ); + } + +} diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/api_response.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/api_response.dart index 77381d6b5e2..954d6a2b721 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/api_response.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/api_response.dart @@ -5,15 +5,14 @@ part 'api_response.g.dart'; abstract class ApiResponse implements Built { - @nullable @BuiltValueField(wireName: r'code') int get code; - + @nullable @BuiltValueField(wireName: r'type') String get type; - + @nullable @BuiltValueField(wireName: r'message') String get message; diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/category.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/category.dart index 46e4a1f7d88..ce3ca3070bd 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/category.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/category.dart @@ -5,11 +5,10 @@ part 'category.g.dart'; abstract class Category implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'name') String get name; diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/order.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/order.dart index 42b467caba6..095b4d45448 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/order.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/order.dart @@ -6,28 +6,28 @@ part 'order.g.dart'; abstract class Order implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'petId') int get petId; - + @nullable @BuiltValueField(wireName: r'quantity') int get quantity; - + @nullable @BuiltValueField(wireName: r'shipDate') DateTime get shipDate; - /* Order Status */ + + /// Order Status @nullable @BuiltValueField(wireName: r'status') OrderStatusEnum get status; // enum statusEnum { placed, approved, delivered, }; - + @nullable @BuiltValueField(wireName: r'complete') bool get complete; diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/pet.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/pet.dart index 134a5e25d54..393376a819c 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/pet.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/pet.dart @@ -8,27 +8,27 @@ part 'pet.g.dart'; abstract class Pet implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'category') Category get category; - + @nullable @BuiltValueField(wireName: r'name') String get name; - + @nullable @BuiltValueField(wireName: r'photoUrls') BuiltList get photoUrls; - + @nullable @BuiltValueField(wireName: r'tags') BuiltList get tags; - /* pet status in the store */ + + /// pet status in the store @nullable @BuiltValueField(wireName: r'status') PetStatusEnum get status; diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/tag.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/tag.dart index 6ff5d3eb3cd..006e3426810 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/tag.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/tag.dart @@ -5,11 +5,10 @@ part 'tag.g.dart'; abstract class Tag implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'name') String get name; diff --git a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/user.dart b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/user.dart index cf78ae941ce..fa480028d7e 100644 --- a/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/user.dart +++ b/samples/client/petstore/dart-dio/petstore_client_lib/lib/model/user.dart @@ -5,35 +5,35 @@ part 'user.g.dart'; abstract class User implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'username') String get username; - + @nullable @BuiltValueField(wireName: r'firstName') String get firstName; - + @nullable @BuiltValueField(wireName: r'lastName') String get lastName; - + @nullable @BuiltValueField(wireName: r'email') String get email; - + @nullable @BuiltValueField(wireName: r'password') String get password; - + @nullable @BuiltValueField(wireName: r'phone') String get phone; - /* User Status */ + + /// User Status @nullable @BuiltValueField(wireName: r'userStatus') int get userStatus; diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart index f9f8e6b1f6f..bd80caff35c 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart @@ -17,13 +17,10 @@ class ApiResponse { this.message, }); - int code; - String type; - String message; @override diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/category.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/category.dart index 67423f6ae0a..c63ffb1734f 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/category.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/category.dart @@ -16,10 +16,8 @@ class Category { this.name, }); - int id; - String name; @override diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/order.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/order.dart index 268f751c0d5..30d60e0120a 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/order.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/order.dart @@ -20,22 +20,17 @@ class Order { this.complete = false, }); - int id; - int petId; - int quantity; - DateTime shipDate; /// Order Status OrderStatusEnum status; - bool complete; @override diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart index a30551385c1..daa1c561e47 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart @@ -20,19 +20,14 @@ class Pet { this.status, }); - int id; - Category category; - String name; - List photoUrls; - List tags; /// pet status in the store diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart index 482c5d6d14b..63132f08a3a 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart @@ -16,10 +16,8 @@ class Tag { this.name, }); - int id; - String name; @override diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/user.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/user.dart index f1f56e3d720..bb512af491f 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/user.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/user.dart @@ -22,25 +22,18 @@ class User { this.userStatus, }); - int id; - String username; - String firstName; - String lastName; - String email; - String password; - String phone; /// User Status diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/Pet.md index 619e45d1848..b7e9e9282a1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/Pet.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/Pet.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **id** | **int** | | [optional] [default to null] **category** | [**Category**](Category.md) | | [optional] [default to null] **name** | **String** | | [default to null] -**photoUrls** | **BuiltList<String>** | | [default to const []] -**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []] +**photoUrls** | **BuiltList** | | [default to const []] +**tags** | [**BuiltList**](Tag.md) | | [optional] [default to const []] **status** | **String** | pet status in the store | [optional] [default to null] [[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/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md index b8185134f3d..c73760c02dc 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/PetApi.md @@ -37,7 +37,7 @@ try { var result = api_instance.addPet(pet); print(result); } catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); + print('Exception when calling PetApi->addPet: $e\n'); } ``` @@ -80,7 +80,7 @@ var apiKey = apiKey_example; // String | try { api_instance.deletePet(petId, apiKey); } catch (e) { - print("Exception when calling PetApi->deletePet: $e\n"); + print('Exception when calling PetApi->deletePet: $e\n'); } ``` @@ -126,7 +126,7 @@ try { var result = api_instance.findPetsByStatus(status); print(result); } catch (e) { - print("Exception when calling PetApi->findPetsByStatus: $e\n"); + print('Exception when calling PetApi->findPetsByStatus: $e\n'); } ``` @@ -134,7 +134,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []] + **status** | [**BuiltList**](String.md)| Status values that need to be considered for filter | [default to const []] ### Return type @@ -171,7 +171,7 @@ try { var result = api_instance.findPetsByTags(tags); print(result); } catch (e) { - print("Exception when calling PetApi->findPetsByTags: $e\n"); + print('Exception when calling PetApi->findPetsByTags: $e\n'); } ``` @@ -179,7 +179,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []] + **tags** | [**BuiltList**](String.md)| Tags to filter by | [default to const []] ### Return type @@ -218,7 +218,7 @@ try { var result = api_instance.getPetById(petId); print(result); } catch (e) { - print("Exception when calling PetApi->getPetById: $e\n"); + print('Exception when calling PetApi->getPetById: $e\n'); } ``` @@ -261,7 +261,7 @@ try { var result = api_instance.updatePet(pet); print(result); } catch (e) { - print("Exception when calling PetApi->updatePet: $e\n"); + print('Exception when calling PetApi->updatePet: $e\n'); } ``` @@ -305,7 +305,7 @@ var status = status_example; // String | Updated status of the pet try { api_instance.updatePetWithForm(petId, name, status); } catch (e) { - print("Exception when calling PetApi->updatePetWithForm: $e\n"); + print('Exception when calling PetApi->updatePetWithForm: $e\n'); } ``` @@ -352,7 +352,7 @@ try { var result = api_instance.uploadFile(petId, additionalMetadata, file); print(result); } catch (e) { - print("Exception when calling PetApi->uploadFile: $e\n"); + print('Exception when calling PetApi->uploadFile: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md index 4755ee09e69..2770b91589d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/StoreApi.md @@ -32,7 +32,7 @@ var orderId = orderId_example; // String | ID of the order that needs to be dele try { api_instance.deleteOrder(orderId); } catch (e) { - print("Exception when calling StoreApi->deleteOrder: $e\n"); + print('Exception when calling StoreApi->deleteOrder: $e\n'); } ``` @@ -78,7 +78,7 @@ try { var result = api_instance.getInventory(); print(result); } catch (e) { - print("Exception when calling StoreApi->getInventory: $e\n"); + print('Exception when calling StoreApi->getInventory: $e\n'); } ``` @@ -118,7 +118,7 @@ try { var result = api_instance.getOrderById(orderId); print(result); } catch (e) { - print("Exception when calling StoreApi->getOrderById: $e\n"); + print('Exception when calling StoreApi->getOrderById: $e\n'); } ``` @@ -159,7 +159,7 @@ try { var result = api_instance.placeOrder(order); print(result); } catch (e) { - print("Exception when calling StoreApi->placeOrder: $e\n"); + print('Exception when calling StoreApi->placeOrder: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md index dfedf9d9e36..27728ac5f89 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/doc/UserApi.md @@ -40,7 +40,7 @@ var user = new User(); // User | Created user object try { api_instance.createUser(user); } catch (e) { - print("Exception when calling UserApi->createUser: $e\n"); + print('Exception when calling UserApi->createUser: $e\n'); } ``` @@ -79,12 +79,12 @@ import 'package:openapi/api.dart'; //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; var api_instance = new UserApi(); -var user = [new BuiltList<User>()]; // BuiltList | List of user object +var user = [new BuiltList()]; // BuiltList | List of user object try { api_instance.createUsersWithArrayInput(user); } catch (e) { - print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); + print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); } ``` @@ -92,7 +92,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**BuiltList<User>**](User.md)| List of user object | + **user** | [**BuiltList**](User.md)| List of user object | ### Return type @@ -123,12 +123,12 @@ import 'package:openapi/api.dart'; //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; var api_instance = new UserApi(); -var user = [new BuiltList<User>()]; // BuiltList | List of user object +var user = [new BuiltList()]; // BuiltList | List of user object try { api_instance.createUsersWithListInput(user); } catch (e) { - print("Exception when calling UserApi->createUsersWithListInput: $e\n"); + print('Exception when calling UserApi->createUsersWithListInput: $e\n'); } ``` @@ -136,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**BuiltList<User>**](User.md)| List of user object | + **user** | [**BuiltList**](User.md)| List of user object | ### Return type @@ -174,7 +174,7 @@ var username = username_example; // String | The name that needs to be deleted try { api_instance.deleteUser(username); } catch (e) { - print("Exception when calling UserApi->deleteUser: $e\n"); + print('Exception when calling UserApi->deleteUser: $e\n'); } ``` @@ -215,7 +215,7 @@ try { var result = api_instance.getUserByName(username); print(result); } catch (e) { - print("Exception when calling UserApi->getUserByName: $e\n"); + print('Exception when calling UserApi->getUserByName: $e\n'); } ``` @@ -257,7 +257,7 @@ try { var result = api_instance.loginUser(username, password); print(result); } catch (e) { - print("Exception when calling UserApi->loginUser: $e\n"); + print('Exception when calling UserApi->loginUser: $e\n'); } ``` @@ -301,7 +301,7 @@ var api_instance = new UserApi(); try { api_instance.logoutUser(); } catch (e) { - print("Exception when calling UserApi->logoutUser: $e\n"); + print('Exception when calling UserApi->logoutUser: $e\n'); } ``` @@ -345,7 +345,7 @@ var user = new User(); // User | Updated user object try { api_instance.updateUser(username, user); } catch (e) { - print("Exception when calling UserApi->updateUser: $e\n"); + print('Exception when calling UserApi->updateUser: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api.dart index 5cca5eafdc6..fb9635ab642 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api.dart @@ -17,7 +17,7 @@ class Openapi { Dio dio; Serializers serializers; - String basePath = "http://petstore.swagger.io/v2"; + String basePath = 'http://petstore.swagger.io/v2'; Openapi({this.dio, Serializers serializers, String basePathOverride, List interceptors}) { if (dio == null) { diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart index 62982eb8239..ee54c2f0cef 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -16,44 +15,55 @@ class PetApi { PetApi(this._dio, this._serializers); - /// Add a new pet to the store - /// - /// - Future>addPet(Pet pet,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Add a new pet to the store + /// + /// + Future>addPet( + Pet pet, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet'; - String _path = "/pet"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json","application/xml"]; + final List contentTypes = [ + 'application/json', + 'application/xml', + ]; + final serializedBody = _serializers.serialize(pet); + final jsonpet = json.encode(serializedBody); + bodyData = jsonpet; - final serializedBody = _serializers.serialize(pet); - final jsonpet = json.encode(serializedBody); - bodyData = jsonpet; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Pet); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -66,80 +76,98 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Deletes a pet - /// - /// - FuturedeletePet(int petId,{ String apiKey,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Deletes a pet + /// + /// + FuturedeletePet( + int petId, { + String apiKey, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - headerParams[r'api_key'] = apiKey; + headerParams[r'api_key'] = apiKey; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - Future>>findPetsByStatus(BuiltList status,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/findByStatus"; + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + Future>>findPetsByStatus( + BuiltList status, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/findByStatus'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'status'] = status; + queryParams[r'status'] = status; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltList; const type = FullType(collectionType, [FullType(Pet)]); final BuiltList data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -153,44 +181,52 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future>>findPetsByTags(BuiltList tags,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet/findByTags"; + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + Future>>findPetsByTags( + BuiltList tags, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/findByTags'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'tags'] = tags; + queryParams[r'tags'] = tags; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltList; const type = FullType(collectionType, [FullType(Pet)]); final BuiltList data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -204,43 +240,53 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Find pet by ID - /// - /// Returns a single pet - Future>getPetById(int petId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Find pet by ID + /// + /// Returns a single pet + Future>getPetById( + int petId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Pet); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -253,46 +299,58 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Update an existing pet - /// - /// - Future>updatePet(Pet pet,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet"; + /// Update an existing pet + /// + /// + Future>updatePet( + Pet pet, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json","application/xml"]; + final List contentTypes = [ + 'application/json', + 'application/xml', + ]; + final serializedBody = _serializers.serialize(pet); + final jsonpet = json.encode(serializedBody); + bodyData = jsonpet; - final serializedBody = _serializers.serialize(pet); - final jsonpet = json.encode(serializedBody); - bodyData = jsonpet; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Pet); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -305,62 +363,86 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Updates a pet in the store with form data - /// - /// - FutureupdatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Updates a pet in the store with form data + /// + /// + FutureupdatePetWithForm( + int petId, { + String name, + String status, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/x-www-form-urlencoded"]; + final List contentTypes = [ + 'application/x-www-form-urlencoded', + ]; final Map formData = {}; formData['name'] = parameterToString(_serializers, name); formData['status'] = parameterToString(_serializers, status); bodyData = formData; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// uploads an image - /// - /// - Future>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/{petId}/uploadImage".replaceAll("{" r'petId' "}", petId.toString()); + /// uploads an image + /// + /// + Future>uploadFile( + int petId, { + String additionalMetadata, + Uint8List file, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["multipart/form-data"]; + final List contentTypes = [ + 'multipart/form-data', + ]; final Map formData = {}; if (additionalMetadata != null) { @@ -371,24 +453,27 @@ class PetApi { } bodyData = FormData.fromMap(formData); - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(ApiResponse); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -401,6 +486,7 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart index bbb101e8235..e22d0a19435 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -13,76 +12,88 @@ class StoreApi { StoreApi(this._dio, this._serializers); - /// Delete purchase order by ID - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - FuturedeleteOrder(String orderId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Delete purchase order by ID + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + FuturedeleteOrder( + String orderId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString()); - String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString()); - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - Future>>getInventory({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/store/inventory"; + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + Future>>getInventory({ + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/inventory'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltMap; const type = FullType(collectionType, [FullType(String), FullType(int)]); final BuiltMap data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -96,43 +107,46 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Find purchase order by ID - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future>getOrderById(int orderId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString()); + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + Future>getOrderById( + int orderId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Order); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -145,46 +159,52 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Place an order for a pet - /// - /// - Future>placeOrder(Order order,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/store/order"; + /// Place an order for a pet + /// + /// + Future>placeOrder( + Order order, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(order); + final jsonorder = json.encode(serializedBody); + bodyData = jsonorder; - final serializedBody = _serializers.serialize(order); - final jsonorder = json.encode(serializedBody); - bodyData = jsonorder; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Order); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -197,6 +217,7 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart index e2801bcd924..63a2e4cc940 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -13,192 +12,247 @@ class UserApi { UserApi(this._dio, this._serializers); - /// Create user - /// - /// This can only be done by the logged in user. - FuturecreateUser(User user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Create user + /// + /// This can only be done by the logged in user. + FuturecreateUser( + User user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user'; - String _path = "/user"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(user); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - final serializedBody = _serializers.serialize(user); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Creates list of users with given input array - /// - /// - FuturecreateUsersWithArrayInput(BuiltList user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/createWithArray"; + /// Creates list of users with given input array + /// + /// + FuturecreateUsersWithArrayInput( + BuiltList user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/createWithArray'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + const type = FullType(BuiltList, [FullType(User)]); + final serializedBody = _serializers.serialize(user, specifiedType: type); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - const type = FullType(BuiltList, [FullType(User)]); - final serializedBody = _serializers.serialize(user, specifiedType: type); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Creates list of users with given input array - /// - /// - FuturecreateUsersWithListInput(BuiltList user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/createWithList"; + /// Creates list of users with given input array + /// + /// + FuturecreateUsersWithListInput( + BuiltList user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/createWithList'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + const type = FullType(BuiltList, [FullType(User)]); + final serializedBody = _serializers.serialize(user, specifiedType: type); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - const type = FullType(BuiltList, [FullType(User)]); - final serializedBody = _serializers.serialize(user, specifiedType: type); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Delete user - /// - /// This can only be done by the logged in user. - FuturedeleteUser(String username,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Delete user + /// + /// This can only be done by the logged in user. + FuturedeleteUser( + String username, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Get user by user name - /// - /// - Future>getUserByName(String username,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Get user by user name + /// + /// + Future>getUserByName( + String username, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(User); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -211,45 +265,49 @@ class UserApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Logs user into the system - /// - /// - Future>loginUser(String username,String password,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/user/login"; + /// Logs user into the system + /// + /// + Future>loginUser( + String username, + String password, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/login'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'username'] = username; - queryParams[r'password'] = password; + queryParams[r'username'] = username; + queryParams[r'password'] = password; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final data = response.data as String; return Response( @@ -261,79 +319,105 @@ class UserApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Logs out current logged in user session - /// - /// - FuturelogoutUser({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/user/logout"; + /// Logs out current logged in user session + /// + /// + FuturelogoutUser({ + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/logout'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Updated user - /// - /// This can only be done by the logged in user. - FutureupdateUser(String username,User user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Updated user + /// + /// This can only be done by the logged in user. + FutureupdateUser( + String username, + User user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(user); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - final serializedBody = _serializers.serialize(user); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - } + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/api_response.dart index 77381d6b5e2..954d6a2b721 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/api_response.dart @@ -5,15 +5,14 @@ part 'api_response.g.dart'; abstract class ApiResponse implements Built { - @nullable @BuiltValueField(wireName: r'code') int get code; - + @nullable @BuiltValueField(wireName: r'type') String get type; - + @nullable @BuiltValueField(wireName: r'message') String get message; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/category.dart index 46e4a1f7d88..ce3ca3070bd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/category.dart @@ -5,11 +5,10 @@ part 'category.g.dart'; abstract class Category implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'name') String get name; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/inline_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/inline_object.dart index 281a2a6505e..dc0ff059470 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/inline_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/inline_object.dart @@ -5,11 +5,12 @@ part 'inline_object.g.dart'; abstract class InlineObject implements Built { - /* Updated name of the pet */ + /// Updated name of the pet @nullable @BuiltValueField(wireName: r'name') String get name; - /* Updated status of the pet */ + + /// Updated status of the pet @nullable @BuiltValueField(wireName: r'status') String get status; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/inline_object1.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/inline_object1.dart index ea094e5ce09..18eeafff1f4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/inline_object1.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/inline_object1.dart @@ -6,11 +6,12 @@ part 'inline_object1.g.dart'; abstract class InlineObject1 implements Built { - /* Additional data to pass to server */ + /// Additional data to pass to server @nullable @BuiltValueField(wireName: r'additionalMetadata') String get additionalMetadata; - /* file to upload */ + + /// file to upload @nullable @BuiltValueField(wireName: r'file') Uint8List get file; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/order.dart index 42b467caba6..095b4d45448 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/order.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/order.dart @@ -6,28 +6,28 @@ part 'order.g.dart'; abstract class Order implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'petId') int get petId; - + @nullable @BuiltValueField(wireName: r'quantity') int get quantity; - + @nullable @BuiltValueField(wireName: r'shipDate') DateTime get shipDate; - /* Order Status */ + + /// Order Status @nullable @BuiltValueField(wireName: r'status') OrderStatusEnum get status; // enum statusEnum { placed, approved, delivered, }; - + @nullable @BuiltValueField(wireName: r'complete') bool get complete; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/pet.dart index 134a5e25d54..393376a819c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/pet.dart @@ -8,27 +8,27 @@ part 'pet.g.dart'; abstract class Pet implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'category') Category get category; - + @nullable @BuiltValueField(wireName: r'name') String get name; - + @nullable @BuiltValueField(wireName: r'photoUrls') BuiltList get photoUrls; - + @nullable @BuiltValueField(wireName: r'tags') BuiltList get tags; - /* pet status in the store */ + + /// pet status in the store @nullable @BuiltValueField(wireName: r'status') PetStatusEnum get status; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/tag.dart index 6ff5d3eb3cd..006e3426810 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/tag.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/tag.dart @@ -5,11 +5,10 @@ part 'tag.g.dart'; abstract class Tag implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'name') String get name; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/user.dart index cf78ae941ce..fa480028d7e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/model/user.dart @@ -5,35 +5,35 @@ part 'user.g.dart'; abstract class User implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'username') String get username; - + @nullable @BuiltValueField(wireName: r'firstName') String get firstName; - + @nullable @BuiltValueField(wireName: r'lastName') String get lastName; - + @nullable @BuiltValueField(wireName: r'email') String get email; - + @nullable @BuiltValueField(wireName: r'password') String get password; - + @nullable @BuiltValueField(wireName: r'phone') String get phone; - /* User Status */ + + /// User Status @nullable @BuiltValueField(wireName: r'userStatus') int get userStatus; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md index 3371005bbd5..425c84470b9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mapProperty** | **BuiltMap<String, String>** | | [optional] [default to const {}] -**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] [default to const {}] +**mapProperty** | **BuiltMap** | | [optional] [default to const {}] +**mapOfMapProperty** | [**BuiltMap>**](BuiltMap.md) | | [optional] [default to const {}] [[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/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AnotherFakeApi.md index 2d116c6f367..08c8fccc847 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AnotherFakeApi.md @@ -30,7 +30,7 @@ try { var result = api_instance.call123testSpecialTags(client); print(result); } catch (e) { - print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n"); + print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md index e378f671ea1..fe512e3a423 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md @@ -8,7 +8,7 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**arrayArrayNumber** | [**BuiltList<BuiltList<num>>**](BuiltList.md) | | [optional] [default to const []] +**arrayArrayNumber** | [**BuiltList>**](BuiltList.md) | | [optional] [default to const []] [[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/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md index 8107066a949..4e1c3df7d09 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md @@ -8,7 +8,7 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**arrayNumber** | **BuiltList<num>** | | [optional] [default to const []] +**arrayNumber** | **BuiltList** | | [optional] [default to const []] [[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/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayTest.md index 3cc123045e8..8d1a3b218f1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayTest.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayTest.md @@ -8,9 +8,9 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**arrayOfString** | **BuiltList<String>** | | [optional] [default to const []] -**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional] [default to const []] -**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.md) | | [optional] [default to const []] +**arrayOfString** | **BuiltList** | | [optional] [default to const []] +**arrayArrayOfInteger** | [**BuiltList>**](BuiltList.md) | | [optional] [default to const []] +**arrayArrayOfModel** | [**BuiltList>**](BuiltList.md) | | [optional] [default to const []] [[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/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DefaultApi.md index 8c885ce0d96..b16e9ddaeee 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DefaultApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DefaultApi.md @@ -27,7 +27,7 @@ try { var result = api_instance.fooGet(); print(result); } catch (e) { - print("Exception when calling DefaultApi->fooGet: $e\n"); + print('Exception when calling DefaultApi->fooGet: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumArrays.md index be2f98d28d7..96c39716383 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumArrays.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumArrays.md @@ -9,7 +9,7 @@ import 'package:openapi/api.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **justSymbol** | **String** | | [optional] [default to null] -**arrayEnum** | **BuiltList<String>** | | [optional] [default to const []] +**arrayEnum** | **BuiltList** | | [optional] [default to const []] [[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/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md index e7661f82818..faac833d21d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md @@ -41,7 +41,7 @@ try { var result = api_instance.fakeHealthGet(); print(result); } catch (e) { - print("Exception when calling FakeApi->fakeHealthGet: $e\n"); + print('Exception when calling FakeApi->fakeHealthGet: $e\n'); } ``` @@ -83,7 +83,7 @@ var header1 = header1_example; // String | header parameter try { api_instance.fakeHttpSignatureTest(pet, query1, header1); } catch (e) { - print("Exception when calling FakeApi->fakeHttpSignatureTest: $e\n"); + print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); } ``` @@ -128,7 +128,7 @@ try { var result = api_instance.fakeOuterBooleanSerialize(body); print(result); } catch (e) { - print("Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n"); + print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n'); } ``` @@ -171,7 +171,7 @@ try { var result = api_instance.fakeOuterCompositeSerialize(outerComposite); print(result); } catch (e) { - print("Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n"); + print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n'); } ``` @@ -214,7 +214,7 @@ try { var result = api_instance.fakeOuterNumberSerialize(body); print(result); } catch (e) { - print("Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n"); + print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n'); } ``` @@ -257,7 +257,7 @@ try { var result = api_instance.fakeOuterStringSerialize(body); print(result); } catch (e) { - print("Exception when calling FakeApi->fakeOuterStringSerialize: $e\n"); + print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n'); } ``` @@ -299,7 +299,7 @@ var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | try { api_instance.testBodyWithFileSchema(fileSchemaTestClass); } catch (e) { - print("Exception when calling FakeApi->testBodyWithFileSchema: $e\n"); + print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n'); } ``` @@ -340,7 +340,7 @@ var user = new User(); // User | try { api_instance.testBodyWithQueryParams(query, user); } catch (e) { - print("Exception when calling FakeApi->testBodyWithQueryParams: $e\n"); + print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n'); } ``` @@ -384,7 +384,7 @@ try { var result = api_instance.testClientModel(client); print(result); } catch (e) { - print("Exception when calling FakeApi->testClientModel: $e\n"); + print('Exception when calling FakeApi->testClientModel: $e\n'); } ``` @@ -442,7 +442,7 @@ var callback = callback_example; // String | None try { api_instance.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); } catch (e) { - print("Exception when calling FakeApi->testEndpointParameters: $e\n"); + print('Exception when calling FakeApi->testEndpointParameters: $e\n'); } ``` @@ -504,7 +504,7 @@ var enumFormString = enumFormString_example; // String | Form parameter enum tes try { api_instance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (e) { - print("Exception when calling FakeApi->testEnumParameters: $e\n"); + print('Exception when calling FakeApi->testEnumParameters: $e\n'); } ``` @@ -512,14 +512,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional] [default to const []] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional] [default to const []] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enumHeaderStringArray** | [**BuiltList**](String.md)| Header parameter enum test (string array) | [optional] [default to const []] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryStringArray** | [**BuiltList**](String.md)| Query parameter enum test (string array) | [optional] [default to const []] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] [default to null] **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] [default to null] - **enumFormStringArray** | [**BuiltList<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] + **enumFormStringArray** | [**BuiltList**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] ### Return type @@ -561,7 +561,7 @@ var int64Group = 789; // int | Integer in group parameters try { api_instance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } catch (e) { - print("Exception when calling FakeApi->testGroupParameters: $e\n"); + print('Exception when calling FakeApi->testGroupParameters: $e\n'); } ``` @@ -601,12 +601,12 @@ test inline additionalProperties import 'package:openapi/api.dart'; var api_instance = new FakeApi(); -var requestBody = new BuiltMap<String, String>(); // BuiltMap | request body +var requestBody = new BuiltMap(); // BuiltMap | request body try { api_instance.testInlineAdditionalProperties(requestBody); } catch (e) { - print("Exception when calling FakeApi->testInlineAdditionalProperties: $e\n"); + print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n'); } ``` @@ -614,7 +614,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requestBody** | [**BuiltMap<String, String>**](String.md)| request body | + **requestBody** | [**BuiltMap**](String.md)| request body | ### Return type @@ -647,7 +647,7 @@ var param2 = param2_example; // String | field2 try { api_instance.testJsonFormData(param, param2); } catch (e) { - print("Exception when calling FakeApi->testJsonFormData: $e\n"); + print('Exception when calling FakeApi->testJsonFormData: $e\n'); } ``` @@ -694,7 +694,7 @@ var context = []; // BuiltList | try { api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } catch (e) { - print("Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n"); + print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } ``` @@ -702,11 +702,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipe** | [**BuiltList<String>**](String.md)| | [default to const []] - **ioutil** | [**BuiltList<String>**](String.md)| | [default to const []] - **http** | [**BuiltList<String>**](String.md)| | [default to const []] - **url** | [**BuiltList<String>**](String.md)| | [default to const []] - **context** | [**BuiltList<String>**](String.md)| | [default to const []] + **pipe** | [**BuiltList**](String.md)| | [default to const []] + **ioutil** | [**BuiltList**](String.md)| | [default to const []] + **http** | [**BuiltList**](String.md)| | [default to const []] + **url** | [**BuiltList**](String.md)| | [default to const []] + **context** | [**BuiltList**](String.md)| | [default to const []] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md index d879d940aca..b21ef287864 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md @@ -34,7 +34,7 @@ try { var result = api_instance.testClassname(client); print(result); } catch (e) { - print("Exception when calling FakeClassnameTags123Api->testClassname: $e\n"); + print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FileSchemaTestClass.md index 3e3af96cf14..935c645cc4e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FileSchemaTestClass.md @@ -9,7 +9,7 @@ import 'package:openapi/api.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **file** | [**MultipartFile**](MultipartFile.md) | | [optional] [default to null] -**files** | [**BuiltList<MultipartFile>**](MultipartFile.md) | | [optional] [default to const []] +**files** | [**BuiltList**](MultipartFile.md) | | [optional] [default to const []] [[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/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md index ec72d8f3abe..9315dc8cc49 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md @@ -23,7 +23,7 @@ Name | Type | Description | Notes **uuid** | **String** | | [optional] [default to null] **password** | **String** | | [default to null] **patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] [default to null] -**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [default to null] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [default to null] [[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/InlineObject2.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineObject2.md index 595c585507f..ec2d57ff078 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineObject2.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineObject2.md @@ -8,7 +8,7 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**enumFormStringArray** | **BuiltList<String>** | Form parameter enum test (string array) | [optional] [default to const []] +**enumFormStringArray** | **BuiltList** | Form parameter enum test (string array) | [optional] [default to const []] **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to '-efg'] [[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/MapTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md index 3a6fa0871ee..d6e1a324476 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md @@ -8,10 +8,10 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mapMapOfString** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] [default to const {}] -**mapOfEnumString** | **BuiltMap<String, String>** | | [optional] [default to const {}] -**directMap** | **BuiltMap<String, bool>** | | [optional] [default to const {}] -**indirectMap** | **BuiltMap<String, bool>** | | [optional] [default to const {}] +**mapMapOfString** | [**BuiltMap>**](BuiltMap.md) | | [optional] [default to const {}] +**mapOfEnumString** | **BuiltMap** | | [optional] [default to const {}] +**directMap** | **BuiltMap** | | [optional] [default to const {}] +**indirectMap** | **BuiltMap** | | [optional] [default to const {}] [[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/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md index 26fadf4d0f1..2ea59399358 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **String** | | [optional] [default to null] **dateTime** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**map** | [**BuiltMap<String, Animal>**](Animal.md) | | [optional] [default to const {}] +**map** | [**BuiltMap**](Animal.md) | | [optional] [default to const {}] [[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/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NullableClass.md index bcc17d7f5e5..240b222ca20 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NullableClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NullableClass.md @@ -14,12 +14,12 @@ Name | Type | Description | Notes **stringProp** | **String** | | [optional] [default to null] **dateProp** | [**DateTime**](DateTime.md) | | [optional] [default to null] **datetimeProp** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []] -**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []] -**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []] -**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}] -**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}] -**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}] +**arrayNullableProp** | [**BuiltList**](JsonObject.md) | | [optional] [default to const []] +**arrayAndItemsNullableProp** | [**BuiltList**](JsonObject.md) | | [optional] [default to const []] +**arrayItemsNullable** | [**BuiltList**](JsonObject.md) | | [optional] [default to const []] +**objectNullableProp** | [**BuiltMap**](JsonObject.md) | | [optional] [default to const {}] +**objectAndItemsNullableProp** | [**BuiltMap**](JsonObject.md) | | [optional] [default to const {}] +**objectItemsNullable** | [**BuiltMap**](JsonObject.md) | | [optional] [default to const {}] [[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/Pet.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Pet.md index 619e45d1848..b7e9e9282a1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Pet.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Pet.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **id** | **int** | | [optional] [default to null] **category** | [**Category**](Category.md) | | [optional] [default to null] **name** | **String** | | [default to null] -**photoUrls** | **BuiltList<String>** | | [default to const []] -**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []] +**photoUrls** | **BuiltList** | | [default to const []] +**tags** | [**BuiltList**](Tag.md) | | [optional] [default to const []] **status** | **String** | pet status in the store | [optional] [default to null] [[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/PetApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetApi.md index 0c22a386f40..709c73e4c63 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetApi.md @@ -37,7 +37,7 @@ var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(pet); } catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); + print('Exception when calling PetApi->addPet: $e\n'); } ``` @@ -80,7 +80,7 @@ var apiKey = apiKey_example; // String | try { api_instance.deletePet(petId, apiKey); } catch (e) { - print("Exception when calling PetApi->deletePet: $e\n"); + print('Exception when calling PetApi->deletePet: $e\n'); } ``` @@ -126,7 +126,7 @@ try { var result = api_instance.findPetsByStatus(status); print(result); } catch (e) { - print("Exception when calling PetApi->findPetsByStatus: $e\n"); + print('Exception when calling PetApi->findPetsByStatus: $e\n'); } ``` @@ -134,7 +134,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []] + **status** | [**BuiltList**](String.md)| Status values that need to be considered for filter | [default to const []] ### Return type @@ -171,7 +171,7 @@ try { var result = api_instance.findPetsByTags(tags); print(result); } catch (e) { - print("Exception when calling PetApi->findPetsByTags: $e\n"); + print('Exception when calling PetApi->findPetsByTags: $e\n'); } ``` @@ -179,7 +179,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []] + **tags** | [**BuiltList**](String.md)| Tags to filter by | [default to const []] ### Return type @@ -218,7 +218,7 @@ try { var result = api_instance.getPetById(petId); print(result); } catch (e) { - print("Exception when calling PetApi->getPetById: $e\n"); + print('Exception when calling PetApi->getPetById: $e\n'); } ``` @@ -260,7 +260,7 @@ var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.updatePet(pet); } catch (e) { - print("Exception when calling PetApi->updatePet: $e\n"); + print('Exception when calling PetApi->updatePet: $e\n'); } ``` @@ -304,7 +304,7 @@ var status = status_example; // String | Updated status of the pet try { api_instance.updatePetWithForm(petId, name, status); } catch (e) { - print("Exception when calling PetApi->updatePetWithForm: $e\n"); + print('Exception when calling PetApi->updatePetWithForm: $e\n'); } ``` @@ -351,7 +351,7 @@ try { var result = api_instance.uploadFile(petId, additionalMetadata, file); print(result); } catch (e) { - print("Exception when calling PetApi->uploadFile: $e\n"); + print('Exception when calling PetApi->uploadFile: $e\n'); } ``` @@ -398,7 +398,7 @@ try { var result = api_instance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); print(result); } catch (e) { - print("Exception when calling PetApi->uploadFileWithRequiredFile: $e\n"); + print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/StoreApi.md index 3731ef5fe7f..a6730d263c4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/StoreApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/StoreApi.md @@ -32,7 +32,7 @@ var orderId = orderId_example; // String | ID of the order that needs to be dele try { api_instance.deleteOrder(orderId); } catch (e) { - print("Exception when calling StoreApi->deleteOrder: $e\n"); + print('Exception when calling StoreApi->deleteOrder: $e\n'); } ``` @@ -78,7 +78,7 @@ try { var result = api_instance.getInventory(); print(result); } catch (e) { - print("Exception when calling StoreApi->getInventory: $e\n"); + print('Exception when calling StoreApi->getInventory: $e\n'); } ``` @@ -118,7 +118,7 @@ try { var result = api_instance.getOrderById(orderId); print(result); } catch (e) { - print("Exception when calling StoreApi->getOrderById: $e\n"); + print('Exception when calling StoreApi->getOrderById: $e\n'); } ``` @@ -159,7 +159,7 @@ try { var result = api_instance.placeOrder(order); print(result); } catch (e) { - print("Exception when calling StoreApi->placeOrder: $e\n"); + print('Exception when calling StoreApi->placeOrder: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/UserApi.md index 16a608ad285..b19dd8f5aa6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/UserApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/UserApi.md @@ -36,7 +36,7 @@ var user = new User(); // User | Created user object try { api_instance.createUser(user); } catch (e) { - print("Exception when calling UserApi->createUser: $e\n"); + print('Exception when calling UserApi->createUser: $e\n'); } ``` @@ -71,12 +71,12 @@ Creates list of users with given input array import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var user = [new BuiltList<User>()]; // BuiltList | List of user object +var user = [new BuiltList()]; // BuiltList | List of user object try { api_instance.createUsersWithArrayInput(user); } catch (e) { - print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); + print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); } ``` @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**BuiltList<User>**](User.md)| List of user object | + **user** | [**BuiltList**](User.md)| List of user object | ### Return type @@ -111,12 +111,12 @@ Creates list of users with given input array import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var user = [new BuiltList<User>()]; // BuiltList | List of user object +var user = [new BuiltList()]; // BuiltList | List of user object try { api_instance.createUsersWithListInput(user); } catch (e) { - print("Exception when calling UserApi->createUsersWithListInput: $e\n"); + print('Exception when calling UserApi->createUsersWithListInput: $e\n'); } ``` @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**BuiltList<User>**](User.md)| List of user object | + **user** | [**BuiltList**](User.md)| List of user object | ### Return type @@ -158,7 +158,7 @@ var username = username_example; // String | The name that needs to be deleted try { api_instance.deleteUser(username); } catch (e) { - print("Exception when calling UserApi->deleteUser: $e\n"); + print('Exception when calling UserApi->deleteUser: $e\n'); } ``` @@ -199,7 +199,7 @@ try { var result = api_instance.getUserByName(username); print(result); } catch (e) { - print("Exception when calling UserApi->getUserByName: $e\n"); + print('Exception when calling UserApi->getUserByName: $e\n'); } ``` @@ -241,7 +241,7 @@ try { var result = api_instance.loginUser(username, password); print(result); } catch (e) { - print("Exception when calling UserApi->loginUser: $e\n"); + print('Exception when calling UserApi->loginUser: $e\n'); } ``` @@ -281,7 +281,7 @@ var api_instance = new UserApi(); try { api_instance.logoutUser(); } catch (e) { - print("Exception when calling UserApi->logoutUser: $e\n"); + print('Exception when calling UserApi->logoutUser: $e\n'); } ``` @@ -321,7 +321,7 @@ var user = new User(); // User | Updated user object try { api_instance.updateUser(username, user); } catch (e) { - print("Exception when calling UserApi->updateUser: $e\n"); + print('Exception when calling UserApi->updateUser: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api.dart index d98f4b08b4e..b614ff61186 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api.dart @@ -21,7 +21,7 @@ class Openapi { Dio dio; Serializers serializers; - String basePath = "http://petstore.swagger.io:80/v2"; + String basePath = 'http://petstore.swagger.io:80/v2'; Openapi({this.dio, Serializers serializers, String basePathOverride, List interceptors}) { if (dio == null) { diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/another_fake_api.dart index 1d53eac21db..cea5cd42417 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/another_fake_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -12,44 +11,49 @@ class AnotherFakeApi { AnotherFakeApi(this._dio, this._serializers); - /// To test special tags - /// - /// To test special tags and operation ID starting with number - Future>call123testSpecialTags(Client client,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// To test special tags + /// + /// To test special tags and operation ID starting with number + Future>call123testSpecialTags( + Client client, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/another-fake/dummy'; - String _path = "/another-fake/dummy"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(client); + final jsonclient = json.encode(serializedBody); + bodyData = jsonclient; - final serializedBody = _serializers.serialize(client); - final jsonclient = json.encode(serializedBody); - bodyData = jsonclient; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'patch'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'patch'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Client); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -62,6 +66,7 @@ class AnotherFakeApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/default_api.dart index 61252491155..ebe1e416b1d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/default_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -12,41 +11,42 @@ class DefaultApi { DefaultApi(this._dio, this._serializers); - /// - /// - /// - Future>fooGet({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// + /// + /// + Future>fooGet({ + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/foo'; - String _path = "/foo"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(InlineResponseDefault); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -59,6 +59,7 @@ class DefaultApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart index 26de26914aa..25a12899622 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -20,41 +19,42 @@ class FakeApi { FakeApi(this._dio, this._serializers); - /// Health check endpoint - /// - /// - Future>fakeHealthGet({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Health check endpoint + /// + /// + Future>fakeHealthGet({ + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/health'; - String _path = "/fake/health"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(HealthCheckResult); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -67,86 +67,107 @@ class FakeApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// test http signature authentication - /// - /// - FuturefakeHttpSignatureTest(Pet pet,{ String query1,String header1,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/fake/http-signature-test"; + /// test http signature authentication + /// + /// + FuturefakeHttpSignatureTest( + Pet pet, { + String query1, + String header1, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/http-signature-test'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - headerParams[r'header_1'] = header1; - queryParams[r'query_1'] = query1; + headerParams[r'header_1'] = header1; + queryParams[r'query_1'] = query1; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json","application/xml"]; + final List contentTypes = [ + 'application/json', + 'application/xml', + ]; + final serializedBody = _serializers.serialize(pet); + final jsonpet = json.encode(serializedBody); + bodyData = jsonpet; - final serializedBody = _serializers.serialize(pet); - final jsonpet = json.encode(serializedBody); - bodyData = jsonpet; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "http", "name": "http_signature_test" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'http', + 'name': 'http_signature_test', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// - /// - /// Test serialization of outer boolean types - Future>fakeOuterBooleanSerialize({ bool body,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/fake/outer/boolean"; + /// + /// + /// Test serialization of outer boolean types + Future>fakeOuterBooleanSerialize({ + bool body, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/outer/boolean'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(body); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - final serializedBody = _serializers.serialize(body); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final data = response.data as bool; return Response( @@ -158,46 +179,52 @@ class FakeApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// - /// - /// Test serialization of object with outer number type - Future>fakeOuterCompositeSerialize({ OuterComposite outerComposite,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/fake/outer/composite"; + /// + /// + /// Test serialization of object with outer number type + Future>fakeOuterCompositeSerialize({ + OuterComposite outerComposite, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/outer/composite'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(outerComposite); + final jsonouterComposite = json.encode(serializedBody); + bodyData = jsonouterComposite; - final serializedBody = _serializers.serialize(outerComposite); - final jsonouterComposite = json.encode(serializedBody); - bodyData = jsonouterComposite; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(OuterComposite); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -210,46 +237,52 @@ class FakeApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// - /// - /// Test serialization of outer number types - Future>fakeOuterNumberSerialize({ num body,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/fake/outer/number"; + /// + /// + /// Test serialization of outer number types + Future>fakeOuterNumberSerialize({ + num body, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/outer/number'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(body); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - final serializedBody = _serializers.serialize(body); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final data = response.data as num; return Response( @@ -261,46 +294,52 @@ class FakeApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// - /// - /// Test serialization of outer string types - Future>fakeOuterStringSerialize({ String body,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/fake/outer/string"; + /// + /// + /// Test serialization of outer string types + Future>fakeOuterStringSerialize({ + String body, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/outer/string'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(body); + final jsonbody = json.encode(serializedBody); + bodyData = jsonbody; - final serializedBody = _serializers.serialize(body); - final jsonbody = json.encode(serializedBody); - bodyData = jsonbody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final data = response.data as String; return Response( @@ -312,123 +351,144 @@ class FakeApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// - /// - /// For this test, the body for this request much reference a schema named `File`. - FuturetestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/fake/body-with-file-schema"; + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + FuturetestBodyWithFileSchema( + FileSchemaTestClass fileSchemaTestClass, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/body-with-file-schema'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(fileSchemaTestClass); + final jsonfileSchemaTestClass = json.encode(serializedBody); + bodyData = jsonfileSchemaTestClass; - final serializedBody = _serializers.serialize(fileSchemaTestClass); - final jsonfileSchemaTestClass = json.encode(serializedBody); - bodyData = jsonfileSchemaTestClass; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// - /// - /// - FuturetestBodyWithQueryParams(String query,User user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/fake/body-with-query-params"; + /// + /// + /// + FuturetestBodyWithQueryParams( + String query, + User user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/body-with-query-params'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'query'] = query; + queryParams[r'query'] = query; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(user); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - final serializedBody = _serializers.serialize(user); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// To test \"client\" model - /// - /// To test \"client\" model - Future>testClientModel(Client client,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/fake"; + /// To test \"client\" model + /// + /// To test \"client\" model + Future>testClientModel( + Client client, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(client); + final jsonclient = json.encode(serializedBody); + bodyData = jsonclient; - final serializedBody = _serializers.serialize(client); - final jsonclient = json.encode(serializedBody); - bodyData = jsonclient; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'patch'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'patch'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Client); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -441,23 +501,44 @@ class FakeApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - FuturetestEndpointParameters(num number,double double_,String patternWithoutDelimiter,String byte,{ int integer,int int32,int int64,double float,String string,Uint8List binary,DateTime date,DateTime dateTime,String password,String callback,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/fake"; + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + FuturetestEndpointParameters( + num number, + double double_, + String patternWithoutDelimiter, + String byte, { + int integer, + int int32, + int int64, + double float, + String string, + Uint8List binary, + DateTime date, + DateTime dateTime, + String password, + String callback, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/x-www-form-urlencoded"]; + final List contentTypes = [ + 'application/x-www-form-urlencoded', + ]; final Map formData = {}; formData['integer'] = parameterToString(_serializers, integer); @@ -476,225 +557,281 @@ class FakeApi { formData['callback'] = parameterToString(_serializers, callback); bodyData = formData; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "http", "name": "http_basic_test" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'http', + 'name': 'http_basic_test', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// To test enum parameters - /// - /// To test enum parameters - FuturetestEnumParameters({ BuiltList enumHeaderStringArray,String enumHeaderString,BuiltList enumQueryStringArray,String enumQueryString,int enumQueryInteger,double enumQueryDouble,BuiltList enumFormStringArray,String enumFormString,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/fake"; + /// To test enum parameters + /// + /// To test enum parameters + FuturetestEnumParameters({ + BuiltList enumHeaderStringArray, + String enumHeaderString, + BuiltList enumQueryStringArray, + String enumQueryString, + int enumQueryInteger, + double enumQueryDouble, + BuiltList enumFormStringArray, + String enumFormString, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - headerParams[r'enum_header_string_array'] = enumHeaderStringArray; - headerParams[r'enum_header_string'] = enumHeaderString; - queryParams[r'enum_query_string_array'] = enumQueryStringArray; - queryParams[r'enum_query_string'] = enumQueryString; - queryParams[r'enum_query_integer'] = enumQueryInteger; - queryParams[r'enum_query_double'] = enumQueryDouble; + headerParams[r'enum_header_string_array'] = enumHeaderStringArray; + headerParams[r'enum_header_string'] = enumHeaderString; + queryParams[r'enum_query_string_array'] = enumQueryStringArray; + queryParams[r'enum_query_string'] = enumQueryString; + queryParams[r'enum_query_integer'] = enumQueryInteger; + queryParams[r'enum_query_double'] = enumQueryDouble; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/x-www-form-urlencoded"]; + final List contentTypes = [ + 'application/x-www-form-urlencoded', + ]; final Map formData = {}; formData['enum_form_string_array'] = parameterToString(_serializers, enumFormStringArray); formData['enum_form_string'] = parameterToString(_serializers, enumFormString); bodyData = formData; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Fake endpoint to test group parameters (optional) - /// - /// Fake endpoint to test group parameters (optional) - FuturetestGroupParameters(int requiredStringGroup,bool requiredBooleanGroup,int requiredInt64Group,{ int stringGroup,bool booleanGroup,int int64Group,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/fake"; + /// Fake endpoint to test group parameters (optional) + /// + /// Fake endpoint to test group parameters (optional) + FuturetestGroupParameters( + int requiredStringGroup, + bool requiredBooleanGroup, + int requiredInt64Group, { + int stringGroup, + bool booleanGroup, + int int64Group, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - headerParams[r'required_boolean_group'] = requiredBooleanGroup; - headerParams[r'boolean_group'] = booleanGroup; - queryParams[r'required_string_group'] = requiredStringGroup; - queryParams[r'required_int64_group'] = requiredInt64Group; - queryParams[r'string_group'] = stringGroup; - queryParams[r'int64_group'] = int64Group; + headerParams[r'required_boolean_group'] = requiredBooleanGroup; + headerParams[r'boolean_group'] = booleanGroup; + queryParams[r'required_string_group'] = requiredStringGroup; + queryParams[r'required_int64_group'] = requiredInt64Group; + queryParams[r'string_group'] = stringGroup; + queryParams[r'int64_group'] = int64Group; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "http", "name": "bearer_test" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'http', + 'name': 'bearer_test', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// test inline additionalProperties - /// - /// - FuturetestInlineAdditionalProperties(BuiltMap requestBody,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/fake/inline-additionalProperties"; + /// test inline additionalProperties + /// + /// + FuturetestInlineAdditionalProperties( + BuiltMap requestBody, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/inline-additionalProperties'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(requestBody); + final jsonrequestBody = json.encode(serializedBody); + bodyData = jsonrequestBody; - final serializedBody = _serializers.serialize(requestBody); - final jsonrequestBody = json.encode(serializedBody); - bodyData = jsonrequestBody; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// test json serialization of form data - /// - /// - FuturetestJsonFormData(String param,String param2,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/fake/jsonFormData"; + /// test json serialization of form data + /// + /// + FuturetestJsonFormData( + String param, + String param2, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/jsonFormData'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/x-www-form-urlencoded"]; + final List contentTypes = [ + 'application/x-www-form-urlencoded', + ]; final Map formData = {}; formData['param'] = parameterToString(_serializers, param); formData['param2'] = parameterToString(_serializers, param2); bodyData = formData; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// - /// - /// To test the collection format in query parameters - FuturetestQueryParameterCollectionFormat(BuiltList pipe,BuiltList ioutil,BuiltList http,BuiltList url,BuiltList context,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/fake/test-query-paramters"; + /// + /// + /// To test the collection format in query parameters + FuturetestQueryParameterCollectionFormat( + BuiltList pipe, + BuiltList ioutil, + BuiltList http, + BuiltList url, + BuiltList context, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/test-query-paramters'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'pipe'] = pipe; - queryParams[r'ioutil'] = ioutil; - queryParams[r'http'] = http; - queryParams[r'url'] = url; - queryParams[r'context'] = context; + queryParams[r'pipe'] = pipe; + queryParams[r'ioutil'] = ioutil; + queryParams[r'http'] = http; + queryParams[r'url'] = url; + queryParams[r'context'] = context; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - } + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart index 6bb3607e11d..b18a9dbce6e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -12,44 +11,56 @@ class FakeClassnameTags123Api { FakeClassnameTags123Api(this._dio, this._serializers); - /// To test class name in snake case - /// - /// To test class name in snake case - Future>testClassname(Client client,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// To test class name in snake case + /// + /// To test class name in snake case + Future>testClassname( + Client client, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake_classname_test'; - String _path = "/fake_classname_test"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(client); + final jsonclient = json.encode(serializedBody); + bodyData = jsonclient; - final serializedBody = _serializers.serialize(client); - final jsonclient = json.encode(serializedBody); - bodyData = jsonclient; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'patch'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key_query", "keyName": "api_key_query", "where": "query" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'patch'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key_query', + 'keyName': 'api_key_query', + 'where': 'query', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Client); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -62,6 +73,7 @@ class FakeClassnameTags123Api { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/pet_api.dart index 20ef02e734f..1e9b180fc49 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/pet_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -16,116 +15,146 @@ class PetApi { PetApi(this._dio, this._serializers); - /// Add a new pet to the store - /// - /// - FutureaddPet(Pet pet,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Add a new pet to the store + /// + /// + FutureaddPet( + Pet pet, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet'; - String _path = "/pet"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json","application/xml"]; + final List contentTypes = [ + 'application/json', + 'application/xml', + ]; + final serializedBody = _serializers.serialize(pet); + final jsonpet = json.encode(serializedBody); + bodyData = jsonpet; - final serializedBody = _serializers.serialize(pet); - final jsonpet = json.encode(serializedBody); - bodyData = jsonpet; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Deletes a pet - /// - /// - FuturedeletePet(int petId,{ String apiKey,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Deletes a pet + /// + /// + FuturedeletePet( + int petId, { + String apiKey, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - headerParams[r'api_key'] = apiKey; + headerParams[r'api_key'] = apiKey; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - Future>>findPetsByStatus(BuiltList status,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/findByStatus"; + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + Future>>findPetsByStatus( + BuiltList status, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/findByStatus'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'status'] = status; + queryParams[r'status'] = status; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltList; const type = FullType(collectionType, [FullType(Pet)]); final BuiltList data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -139,44 +168,52 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future>>findPetsByTags(BuiltList tags,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet/findByTags"; + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + Future>>findPetsByTags( + BuiltList tags, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/findByTags'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'tags'] = tags; + queryParams[r'tags'] = tags; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltList; const type = FullType(collectionType, [FullType(Pet)]); final BuiltList data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -190,43 +227,53 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Find pet by ID - /// - /// Returns a single pet - Future>getPetById(int petId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Find pet by ID + /// + /// Returns a single pet + Future>getPetById( + int petId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Pet); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -239,100 +286,137 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Update an existing pet - /// - /// - FutureupdatePet(Pet pet,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/pet"; + /// Update an existing pet + /// + /// + FutureupdatePet( + Pet pet, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json","application/xml"]; + final List contentTypes = [ + 'application/json', + 'application/xml', + ]; + final serializedBody = _serializers.serialize(pet); + final jsonpet = json.encode(serializedBody); + bodyData = jsonpet; - final serializedBody = _serializers.serialize(pet); - final jsonpet = json.encode(serializedBody); - bodyData = jsonpet; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Updates a pet in the store with form data - /// - /// - FutureupdatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); + /// Updates a pet in the store with form data + /// + /// + FutureupdatePetWithForm( + int petId, { + String name, + String status, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/x-www-form-urlencoded"]; + final List contentTypes = [ + 'application/x-www-form-urlencoded', + ]; final Map formData = {}; formData['name'] = parameterToString(_serializers, name); formData['status'] = parameterToString(_serializers, status); bodyData = formData; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// uploads an image - /// - /// - Future>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/pet/{petId}/uploadImage".replaceAll("{" r'petId' "}", petId.toString()); + /// uploads an image + /// + /// + Future>uploadFile( + int petId, { + String additionalMetadata, + Uint8List file, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["multipart/form-data"]; + final List contentTypes = [ + 'multipart/form-data', + ]; final Map formData = {}; if (additionalMetadata != null) { @@ -343,24 +427,27 @@ class PetApi { } bodyData = FormData.fromMap(formData); - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(ApiResponse); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -373,23 +460,33 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// uploads an image (required) - /// - /// - Future>uploadFileWithRequiredFile(int petId,Uint8List requiredFile,{ String additionalMetadata,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("{" r'petId' "}", petId.toString()); + /// uploads an image (required) + /// + /// + Future>uploadFileWithRequiredFile( + int petId, + Uint8List requiredFile, { + String additionalMetadata, + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["multipart/form-data"]; + final List contentTypes = [ + 'multipart/form-data', + ]; final Map formData = {}; if (additionalMetadata != null) { @@ -400,24 +497,27 @@ class PetApi { } bodyData = FormData.fromMap(formData); - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "oauth2", "name": "petstore_auth" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(ApiResponse); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -430,6 +530,7 @@ class PetApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/store_api.dart index 5f43c7dc8ca..41ee378c75f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/store_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -13,76 +12,88 @@ class StoreApi { StoreApi(this._dio, this._serializers); - /// Delete purchase order by ID - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - FuturedeleteOrder(String orderId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Delete purchase order by ID + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + FuturedeleteOrder( + String orderId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - String _path = "/store/order/{order_id}".replaceAll("{" r'order_id' "}", orderId.toString()); - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - Future>>getInventory({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/store/inventory"; + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + Future>>getInventory({ + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/inventory'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { const collectionType = BuiltMap; const type = FullType(collectionType, [FullType(String), FullType(int)]); final BuiltMap data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type); @@ -96,43 +107,46 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Find purchase order by ID - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future>getOrderById(int orderId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/store/order/{order_id}".replaceAll("{" r'order_id' "}", orderId.toString()); + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + Future>getOrderById( + int orderId, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Order); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -145,46 +159,52 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Place an order for a pet - /// - /// - Future>placeOrder(Order order,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/store/order"; + /// Place an order for a pet + /// + /// + Future>placeOrder( + Order order, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/store/order'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(order); + final jsonorder = json.encode(serializedBody); + bodyData = jsonorder; - final serializedBody = _serializers.serialize(order); - final jsonorder = json.encode(serializedBody); - bodyData = jsonorder; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(Order); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -197,6 +217,7 @@ class StoreApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - } + }); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/user_api.dart index f99d40f56ac..2d10af5d80b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/user_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; @@ -13,192 +12,219 @@ class UserApi { UserApi(this._dio, this._serializers); - /// Create user - /// - /// This can only be done by the logged in user. - FuturecreateUser(User user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + /// Create user + /// + /// This can only be done by the logged in user. + FuturecreateUser( + User user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user'; - String _path = "/user"; - - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(user); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - final serializedBody = _serializers.serialize(user); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Creates list of users with given input array - /// - /// - FuturecreateUsersWithArrayInput(BuiltList user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/createWithArray"; + /// Creates list of users with given input array + /// + /// + FuturecreateUsersWithArrayInput( + BuiltList user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/createWithArray'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + const type = FullType(BuiltList, [FullType(User)]); + final serializedBody = _serializers.serialize(user, specifiedType: type); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - const type = FullType(BuiltList, [FullType(User)]); - final serializedBody = _serializers.serialize(user, specifiedType: type); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Creates list of users with given input array - /// - /// - FuturecreateUsersWithListInput(BuiltList user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/createWithList"; + /// Creates list of users with given input array + /// + /// + FuturecreateUsersWithListInput( + BuiltList user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/createWithList'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + const type = FullType(BuiltList, [FullType(User)]); + final serializedBody = _serializers.serialize(user, specifiedType: type); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - const type = FullType(BuiltList, [FullType(User)]); - final serializedBody = _serializers.serialize(user, specifiedType: type); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'post'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Delete user - /// - /// This can only be done by the logged in user. - FuturedeleteUser(String username,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Delete user + /// + /// This can only be done by the logged in user. + FuturedeleteUser( + String username, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'delete'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Get user by user name - /// - /// - Future>getUserByName(String username,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Get user by user name + /// + /// + Future>getUserByName( + String username, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final serializer = _serializers.serializerForType(User); final data = _serializers.deserializeWith(serializer, response.data is String ? jsonDecode(response.data) : response.data); @@ -211,45 +237,49 @@ class UserApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Logs user into the system - /// - /// - Future>loginUser(String username,String password,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/user/login"; + /// Logs user into the system + /// + /// + Future>loginUser( + String username, + String password, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/login'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams[r'username'] = username; - queryParams[r'password'] = password; + queryParams[r'username'] = username; + queryParams[r'password'] = password; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ).then((response) { - + ).then((response) { final data = response.data as String; return Response( @@ -261,79 +291,91 @@ class UserApi { statusMessage: response.statusMessage, extra: response.extra, ); - }); - } - /// Logs out current logged in user session - /// - /// - FuturelogoutUser({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + }); + } - String _path = "/user/logout"; + /// Logs out current logged in user session + /// + /// + FuturelogoutUser({ + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/logout'; - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = []; + final List contentTypes = []; - - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'get'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - /// Updated user - /// - /// This can only be done by the logged in user. - FutureupdateUser(String username,User user,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { + ); + } - String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); + /// Updated user + /// + /// This can only be done by the logged in user. + FutureupdateUser( + String username, + User user, { + CancelToken cancelToken, + Map headers, + ProgressCallback onSendProgress, + ProgressCallback onReceiveProgress, + }) async { + final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); + final Map queryParams = {}; + final Map headerParams = Map.from(headers ?? {}); dynamic bodyData; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json"]; + final List contentTypes = [ + 'application/json', + ]; + final serializedBody = _serializers.serialize(user); + final jsonuser = json.encode(serializedBody); + bodyData = jsonuser; - final serializedBody = _serializers.serialize(user); - final jsonuser = json.encode(serializedBody); - bodyData = jsonuser; - - return _dio.request( + return _dio.request( _path, queryParameters: queryParams, data: bodyData, options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - extra: { - 'secure': [], - }, - contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + method: 'put'.toUpperCase(), + headers: headerParams, + extra: { + 'secure': [], + }, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json', ), cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); - } - } + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/additional_properties_class.dart index b4f78aa5d79..3f643a8e81f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/additional_properties_class.dart @@ -6,11 +6,10 @@ part 'additional_properties_class.g.dart'; abstract class AdditionalPropertiesClass implements Built { - @nullable @BuiltValueField(wireName: r'map_property') BuiltMap get mapProperty; - + @nullable @BuiltValueField(wireName: r'map_of_map_property') BuiltMap> get mapOfMapProperty; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/animal.dart index 5b90bf9deb6..3af06b0b0ff 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/animal.dart @@ -5,11 +5,10 @@ part 'animal.g.dart'; abstract class Animal implements Built { - @nullable @BuiltValueField(wireName: r'className') String get className; - + @nullable @BuiltValueField(wireName: r'color') String get color; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/api_response.dart index 77381d6b5e2..954d6a2b721 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/api_response.dart @@ -5,15 +5,14 @@ part 'api_response.g.dart'; abstract class ApiResponse implements Built { - @nullable @BuiltValueField(wireName: r'code') int get code; - + @nullable @BuiltValueField(wireName: r'type') String get type; - + @nullable @BuiltValueField(wireName: r'message') String get message; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart index 881680996f4..9563de02022 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart @@ -6,7 +6,6 @@ part 'array_of_array_of_number_only.g.dart'; abstract class ArrayOfArrayOfNumberOnly implements Built { - @nullable @BuiltValueField(wireName: r'ArrayArrayNumber') BuiltList> get arrayArrayNumber; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_of_number_only.dart index 0ec79a5d826..5ab814cb813 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_of_number_only.dart @@ -6,7 +6,6 @@ part 'array_of_number_only.g.dart'; abstract class ArrayOfNumberOnly implements Built { - @nullable @BuiltValueField(wireName: r'ArrayNumber') BuiltList get arrayNumber; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_test.dart index 7af4ca09ded..84365633d1c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/array_test.dart @@ -7,15 +7,14 @@ part 'array_test.g.dart'; abstract class ArrayTest implements Built { - @nullable @BuiltValueField(wireName: r'array_of_string') BuiltList get arrayOfString; - + @nullable @BuiltValueField(wireName: r'array_array_of_integer') BuiltList> get arrayArrayOfInteger; - + @nullable @BuiltValueField(wireName: r'array_array_of_model') BuiltList> get arrayArrayOfModel; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/capitalization.dart index 14223f6d298..c616b2c11cb 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/capitalization.dart @@ -5,27 +5,27 @@ part 'capitalization.g.dart'; abstract class Capitalization implements Built { - @nullable @BuiltValueField(wireName: r'smallCamel') String get smallCamel; - + @nullable @BuiltValueField(wireName: r'CapitalCamel') String get capitalCamel; - + @nullable @BuiltValueField(wireName: r'small_Snake') String get smallSnake; - + @nullable @BuiltValueField(wireName: r'Capital_Snake') String get capitalSnake; - + @nullable @BuiltValueField(wireName: r'SCA_ETH_Flow_Points') String get sCAETHFlowPoints; - /* Name of the pet */ + + /// Name of the pet @nullable @BuiltValueField(wireName: r'ATT_NAME') String get ATT_NAME; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/cat.dart index c692db29f92..82c37819a7c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/cat.dart @@ -7,15 +7,14 @@ part 'cat.g.dart'; abstract class Cat implements Built { - @nullable @BuiltValueField(wireName: r'className') String get className; - + @nullable @BuiltValueField(wireName: r'color') String get color; - + @nullable @BuiltValueField(wireName: r'declawed') bool get declawed; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/cat_all_of.dart index 331a86c32ac..0b436c34640 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/cat_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/cat_all_of.dart @@ -5,7 +5,6 @@ part 'cat_all_of.g.dart'; abstract class CatAllOf implements Built { - @nullable @BuiltValueField(wireName: r'declawed') bool get declawed; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/category.dart index 46e4a1f7d88..ce3ca3070bd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/category.dart @@ -5,11 +5,10 @@ part 'category.g.dart'; abstract class Category implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'name') String get name; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/class_model.dart index 028826b1c89..04f6e80b872 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/class_model.dart @@ -5,7 +5,6 @@ part 'class_model.g.dart'; abstract class ClassModel implements Built { - @nullable @BuiltValueField(wireName: r'_class') String get class_; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/client.dart index 0fed7f6c2f2..e8b4facd32e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/client.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/client.dart @@ -5,7 +5,6 @@ part 'client.g.dart'; abstract class Client implements Built { - @nullable @BuiltValueField(wireName: r'client') String get client; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/dog.dart index b3787f304b1..c95f3f060d4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/dog.dart @@ -7,15 +7,14 @@ part 'dog.g.dart'; abstract class Dog implements Built { - @nullable @BuiltValueField(wireName: r'className') String get className; - + @nullable @BuiltValueField(wireName: r'color') String get color; - + @nullable @BuiltValueField(wireName: r'breed') String get breed; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/dog_all_of.dart index 6a1654ebe99..9d424755b03 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/dog_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/dog_all_of.dart @@ -5,7 +5,6 @@ part 'dog_all_of.g.dart'; abstract class DogAllOf implements Built { - @nullable @BuiltValueField(wireName: r'breed') String get breed; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_arrays.dart index 9c88450ec68..36bdfabbb98 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_arrays.dart @@ -6,12 +6,11 @@ part 'enum_arrays.g.dart'; abstract class EnumArrays implements Built { - @nullable @BuiltValueField(wireName: r'just_symbol') EnumArraysJustSymbolEnum get justSymbol; - // enum justSymbolEnum { >=, $, }; - + // enum justSymbolEnum { >=, $, }; + @nullable @BuiltValueField(wireName: r'array_enum') BuiltList get arrayEnum; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_test.dart index d3eac099250..72427403b00 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_test.dart @@ -10,42 +10,41 @@ part 'enum_test.g.dart'; abstract class EnumTest implements Built { - @nullable @BuiltValueField(wireName: r'enum_string') EnumTestEnumStringEnum get enumString; // enum enumStringEnum { UPPER, lower, , }; - + @nullable @BuiltValueField(wireName: r'enum_string_required') EnumTestEnumStringRequiredEnum get enumStringRequired; // enum enumStringRequiredEnum { UPPER, lower, , }; - + @nullable @BuiltValueField(wireName: r'enum_integer') EnumTestEnumIntegerEnum get enumInteger; // enum enumIntegerEnum { 1, -1, }; - + @nullable @BuiltValueField(wireName: r'enum_number') EnumTestEnumNumberEnum get enumNumber; // enum enumNumberEnum { 1.1, -1.2, }; - + @nullable @BuiltValueField(wireName: r'outerEnum') OuterEnum get outerEnum; // enum outerEnumEnum { placed, approved, delivered, }; - + @nullable @BuiltValueField(wireName: r'outerEnumInteger') OuterEnumInteger get outerEnumInteger; // enum outerEnumIntegerEnum { 0, 1, 2, }; - + @nullable @BuiltValueField(wireName: r'outerEnumDefaultValue') OuterEnumDefaultValue get outerEnumDefaultValue; // enum outerEnumDefaultValueEnum { placed, approved, delivered, }; - + @nullable @BuiltValueField(wireName: r'outerEnumIntegerDefaultValue') OuterEnumIntegerDefaultValue get outerEnumIntegerDefaultValue; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/file.dart index db11b10fe2f..27b2e69c416 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/file.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/file.dart @@ -5,7 +5,7 @@ part 'file.g.dart'; abstract class File implements Built { - /* Test capitalization */ + /// Test capitalization @nullable @BuiltValueField(wireName: r'sourceURI') String get sourceURI; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/file_schema_test_class.dart index da0d549aa38..96894cc0c3f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/file_schema_test_class.dart @@ -7,11 +7,10 @@ part 'file_schema_test_class.g.dart'; abstract class FileSchemaTestClass implements Built { - @nullable @BuiltValueField(wireName: r'file') MultipartFile get file; - + @nullable @BuiltValueField(wireName: r'files') BuiltList get files; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/foo.dart index 6ccd1f51fb9..d4f91044022 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/foo.dart @@ -5,7 +5,6 @@ part 'foo.g.dart'; abstract class Foo implements Built { - @nullable @BuiltValueField(wireName: r'bar') String get bar; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/format_test.dart index de4c8bb51db..493b2b3be31 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/format_test.dart @@ -6,67 +6,68 @@ part 'format_test.g.dart'; abstract class FormatTest implements Built { - @nullable @BuiltValueField(wireName: r'integer') int get integer; - + @nullable @BuiltValueField(wireName: r'int32') int get int32; - + @nullable @BuiltValueField(wireName: r'int64') int get int64; - + @nullable @BuiltValueField(wireName: r'number') num get number; - + @nullable @BuiltValueField(wireName: r'float') double get float; - + @nullable @BuiltValueField(wireName: r'double') double get double_; - + @nullable @BuiltValueField(wireName: r'decimal') double get decimal; - + @nullable @BuiltValueField(wireName: r'string') String get string; - + @nullable @BuiltValueField(wireName: r'byte') String get byte; - + @nullable @BuiltValueField(wireName: r'binary') Uint8List get binary; - + @nullable @BuiltValueField(wireName: r'date') DateTime get date; - + @nullable @BuiltValueField(wireName: r'dateTime') DateTime get dateTime; - + @nullable @BuiltValueField(wireName: r'uuid') String get uuid; - + @nullable @BuiltValueField(wireName: r'password') String get password; - /* A string that is a 10 digit number. Can have leading zeros. */ + + /// A string that is a 10 digit number. Can have leading zeros. @nullable @BuiltValueField(wireName: r'pattern_with_digits') String get patternWithDigits; - /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. @nullable @BuiltValueField(wireName: r'pattern_with_digits_and_delimiter') String get patternWithDigitsAndDelimiter; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/has_only_read_only.dart index 323a0933628..58b72184eb9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/has_only_read_only.dart @@ -5,11 +5,10 @@ part 'has_only_read_only.g.dart'; abstract class HasOnlyReadOnly implements Built { - @nullable @BuiltValueField(wireName: r'bar') String get bar; - + @nullable @BuiltValueField(wireName: r'foo') String get foo; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/health_check_result.dart index 699a32d0870..1e985b34437 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/health_check_result.dart @@ -5,7 +5,6 @@ part 'health_check_result.g.dart'; abstract class HealthCheckResult implements Built { - @nullable @BuiltValueField(wireName: r'NullableMessage') String get nullableMessage; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object.dart index 281a2a6505e..dc0ff059470 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object.dart @@ -5,11 +5,12 @@ part 'inline_object.g.dart'; abstract class InlineObject implements Built { - /* Updated name of the pet */ + /// Updated name of the pet @nullable @BuiltValueField(wireName: r'name') String get name; - /* Updated status of the pet */ + + /// Updated status of the pet @nullable @BuiltValueField(wireName: r'status') String get status; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object1.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object1.dart index ea094e5ce09..18eeafff1f4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object1.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object1.dart @@ -6,11 +6,12 @@ part 'inline_object1.g.dart'; abstract class InlineObject1 implements Built { - /* Additional data to pass to server */ + /// Additional data to pass to server @nullable @BuiltValueField(wireName: r'additionalMetadata') String get additionalMetadata; - /* file to upload */ + + /// file to upload @nullable @BuiltValueField(wireName: r'file') Uint8List get file; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object2.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object2.dart index 8699255b041..fd7a999ff99 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object2.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object2.dart @@ -6,12 +6,13 @@ part 'inline_object2.g.dart'; abstract class InlineObject2 implements Built { - /* Form parameter enum test (string array) */ + /// Form parameter enum test (string array) @nullable @BuiltValueField(wireName: r'enum_form_string_array') BuiltList get enumFormStringArray; - // enum enumFormStringArrayEnum { >, $, }; - /* Form parameter enum test (string) */ + // enum enumFormStringArrayEnum { >, $, }; + + /// Form parameter enum test (string) @nullable @BuiltValueField(wireName: r'enum_form_string') InlineObject2EnumFormStringEnum get enumFormString; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object3.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object3.dart index 960cb97aa6e..a5e7526f9a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object3.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object3.dart @@ -6,59 +6,72 @@ part 'inline_object3.g.dart'; abstract class InlineObject3 implements Built { - /* None */ + /// None @nullable @BuiltValueField(wireName: r'integer') int get integer; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'int32') int get int32; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'int64') int get int64; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'number') num get number; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'float') double get float; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'double') double get double_; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'string') String get string; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'pattern_without_delimiter') String get patternWithoutDelimiter; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'byte') String get byte; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'binary') Uint8List get binary; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'date') DateTime get date; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'dateTime') DateTime get dateTime; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'password') String get password; - /* None */ + + /// None @nullable @BuiltValueField(wireName: r'callback') String get callback; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object4.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object4.dart index 7e3e6ac921b..c33b4c9c317 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object4.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object4.dart @@ -5,11 +5,12 @@ part 'inline_object4.g.dart'; abstract class InlineObject4 implements Built { - /* field1 */ + /// field1 @nullable @BuiltValueField(wireName: r'param') String get param; - /* field2 */ + + /// field2 @nullable @BuiltValueField(wireName: r'param2') String get param2; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object5.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object5.dart index bd8dfcc4f35..ffeb2fd62fa 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object5.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_object5.dart @@ -6,11 +6,12 @@ part 'inline_object5.g.dart'; abstract class InlineObject5 implements Built { - /* Additional data to pass to server */ + /// Additional data to pass to server @nullable @BuiltValueField(wireName: r'additionalMetadata') String get additionalMetadata; - /* file to upload */ + + /// file to upload @nullable @BuiltValueField(wireName: r'requiredFile') Uint8List get requiredFile; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_response_default.dart index 1f9507deb9b..2e2cf922423 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_response_default.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/inline_response_default.dart @@ -6,7 +6,6 @@ part 'inline_response_default.g.dart'; abstract class InlineResponseDefault implements Built { - @nullable @BuiltValueField(wireName: r'string') Foo get string; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/map_test.dart index 3ec4c747b4d..ef4b0b9794b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/map_test.dart @@ -6,20 +6,19 @@ part 'map_test.g.dart'; abstract class MapTest implements Built { - @nullable @BuiltValueField(wireName: r'map_map_of_string') BuiltMap> get mapMapOfString; - + @nullable @BuiltValueField(wireName: r'map_of_enum_string') BuiltMap get mapOfEnumString; // enum mapOfEnumStringEnum { UPPER, lower, }; - + @nullable @BuiltValueField(wireName: r'direct_map') BuiltMap get directMap; - + @nullable @BuiltValueField(wireName: r'indirect_map') BuiltMap get indirectMap; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart index f8f57817314..fab066f4e22 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart @@ -7,15 +7,14 @@ part 'mixed_properties_and_additional_properties_class.g.dart'; abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { - @nullable @BuiltValueField(wireName: r'uuid') String get uuid; - + @nullable @BuiltValueField(wireName: r'dateTime') DateTime get dateTime; - + @nullable @BuiltValueField(wireName: r'map') BuiltMap get map; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/model200_response.dart index cd7af9bce9c..d1e9eba050a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/model200_response.dart @@ -5,11 +5,10 @@ part 'model200_response.g.dart'; abstract class Model200Response implements Built { - @nullable @BuiltValueField(wireName: r'name') int get name; - + @nullable @BuiltValueField(wireName: r'class') String get class_; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/model_return.dart index e3afe247cc1..3f8eb1004e6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/model_return.dart @@ -5,7 +5,6 @@ part 'model_return.g.dart'; abstract class ModelReturn implements Built { - @nullable @BuiltValueField(wireName: r'return') int get return_; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/name.dart index 958619cfe08..2309150bffa 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/name.dart @@ -5,19 +5,18 @@ part 'name.g.dart'; abstract class Name implements Built { - @nullable @BuiltValueField(wireName: r'name') int get name; - + @nullable @BuiltValueField(wireName: r'snake_case') int get snakeCase; - + @nullable @BuiltValueField(wireName: r'property') String get property; - + @nullable @BuiltValueField(wireName: r'123Number') int get n123number; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/nullable_class.dart index d0594cab0a2..9840000d6f4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/nullable_class.dart @@ -7,51 +7,50 @@ part 'nullable_class.g.dart'; abstract class NullableClass implements Built { - @nullable @BuiltValueField(wireName: r'integer_prop') int get integerProp; - + @nullable @BuiltValueField(wireName: r'number_prop') num get numberProp; - + @nullable @BuiltValueField(wireName: r'boolean_prop') bool get booleanProp; - + @nullable @BuiltValueField(wireName: r'string_prop') String get stringProp; - + @nullable @BuiltValueField(wireName: r'date_prop') DateTime get dateProp; - + @nullable @BuiltValueField(wireName: r'datetime_prop') DateTime get datetimeProp; - + @nullable @BuiltValueField(wireName: r'array_nullable_prop') BuiltList get arrayNullableProp; - + @nullable @BuiltValueField(wireName: r'array_and_items_nullable_prop') BuiltList get arrayAndItemsNullableProp; - + @nullable @BuiltValueField(wireName: r'array_items_nullable') BuiltList get arrayItemsNullable; - + @nullable @BuiltValueField(wireName: r'object_nullable_prop') BuiltMap get objectNullableProp; - + @nullable @BuiltValueField(wireName: r'object_and_items_nullable_prop') BuiltMap get objectAndItemsNullableProp; - + @nullable @BuiltValueField(wireName: r'object_items_nullable') BuiltMap get objectItemsNullable; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/number_only.dart index e38815d4b94..2a700465952 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/number_only.dart @@ -5,7 +5,6 @@ part 'number_only.g.dart'; abstract class NumberOnly implements Built { - @nullable @BuiltValueField(wireName: r'JustNumber') num get justNumber; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/order.dart index 42b467caba6..095b4d45448 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/order.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/order.dart @@ -6,28 +6,28 @@ part 'order.g.dart'; abstract class Order implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'petId') int get petId; - + @nullable @BuiltValueField(wireName: r'quantity') int get quantity; - + @nullable @BuiltValueField(wireName: r'shipDate') DateTime get shipDate; - /* Order Status */ + + /// Order Status @nullable @BuiltValueField(wireName: r'status') OrderStatusEnum get status; // enum statusEnum { placed, approved, delivered, }; - + @nullable @BuiltValueField(wireName: r'complete') bool get complete; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/outer_composite.dart index dd60f4deb44..b252c5ea019 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/outer_composite.dart @@ -5,15 +5,14 @@ part 'outer_composite.g.dart'; abstract class OuterComposite implements Built { - @nullable @BuiltValueField(wireName: r'my_number') num get myNumber; - + @nullable @BuiltValueField(wireName: r'my_string') String get myString; - + @nullable @BuiltValueField(wireName: r'my_boolean') bool get myBoolean; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/pet.dart index 134a5e25d54..393376a819c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/pet.dart @@ -8,27 +8,27 @@ part 'pet.g.dart'; abstract class Pet implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'category') Category get category; - + @nullable @BuiltValueField(wireName: r'name') String get name; - + @nullable @BuiltValueField(wireName: r'photoUrls') BuiltList get photoUrls; - + @nullable @BuiltValueField(wireName: r'tags') BuiltList get tags; - /* pet status in the store */ + + /// pet status in the store @nullable @BuiltValueField(wireName: r'status') PetStatusEnum get status; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/read_only_first.dart index abfa9f4408e..72346def77d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/read_only_first.dart @@ -5,11 +5,10 @@ part 'read_only_first.g.dart'; abstract class ReadOnlyFirst implements Built { - @nullable @BuiltValueField(wireName: r'bar') String get bar; - + @nullable @BuiltValueField(wireName: r'baz') String get baz; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/special_model_name.dart index 583d07d9b1b..e7dc9cf4e7a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/special_model_name.dart @@ -5,7 +5,6 @@ part 'special_model_name.g.dart'; abstract class SpecialModelName implements Built { - @nullable @BuiltValueField(wireName: r'$special[property.name]') int get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/tag.dart index 6ff5d3eb3cd..006e3426810 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/tag.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/tag.dart @@ -5,11 +5,10 @@ part 'tag.g.dart'; abstract class Tag implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'name') String get name; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/user.dart index cf78ae941ce..fa480028d7e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/user.dart @@ -5,35 +5,35 @@ part 'user.g.dart'; abstract class User implements Built { - @nullable @BuiltValueField(wireName: r'id') int get id; - + @nullable @BuiltValueField(wireName: r'username') String get username; - + @nullable @BuiltValueField(wireName: r'firstName') String get firstName; - + @nullable @BuiltValueField(wireName: r'lastName') String get lastName; - + @nullable @BuiltValueField(wireName: r'email') String get email; - + @nullable @BuiltValueField(wireName: r'password') String get password; - + @nullable @BuiltValueField(wireName: r'phone') String get phone; - /* User Status */ + + /// User Status @nullable @BuiltValueField(wireName: r'userStatus') int get userStatus; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart index f9f8e6b1f6f..bd80caff35c 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart @@ -17,13 +17,10 @@ class ApiResponse { this.message, }); - int code; - String type; - String message; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/category.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/category.dart index 67423f6ae0a..c63ffb1734f 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/category.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/category.dart @@ -16,10 +16,8 @@ class Category { this.name, }); - int id; - String name; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart index 268f751c0d5..30d60e0120a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart @@ -20,22 +20,17 @@ class Order { this.complete = false, }); - int id; - int petId; - int quantity; - DateTime shipDate; /// Order Status OrderStatusEnum status; - bool complete; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart index a30551385c1..daa1c561e47 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart @@ -20,19 +20,14 @@ class Pet { this.status, }); - int id; - Category category; - String name; - List photoUrls; - List tags; /// pet status in the store diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart index 482c5d6d14b..63132f08a3a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart @@ -16,10 +16,8 @@ class Tag { this.name, }); - int id; - String name; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/user.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/user.dart index f1f56e3d720..bb512af491f 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/user.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/user.dart @@ -22,25 +22,18 @@ class User { this.userStatus, }); - int id; - String username; - String firstName; - String lastName; - String email; - String password; - String phone; /// User Status diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/additional_properties_class.dart index fbbecceba03..9e021e550b0 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/additional_properties_class.dart @@ -16,10 +16,8 @@ class AdditionalPropertiesClass { this.mapOfMapProperty = const {}, }); - Map mapProperty; - Map> mapOfMapProperty; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/animal.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/animal.dart index 35f24f95d00..9ed72c81ba5 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/animal.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/animal.dart @@ -16,10 +16,8 @@ class Animal { this.color = 'red', }); - String className; - String color; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/api_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/api_response.dart index f9f8e6b1f6f..bd80caff35c 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/api_response.dart @@ -17,13 +17,10 @@ class ApiResponse { this.message, }); - int code; - String type; - String message; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart index faed21fa93a..7dac34b25c1 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_array_of_number_only.dart @@ -15,7 +15,6 @@ class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = const [], }); - List> arrayArrayNumber; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_number_only.dart index bc1f7f32cf8..7a1de48923a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_of_number_only.dart @@ -15,7 +15,6 @@ class ArrayOfNumberOnly { this.arrayNumber = const [], }); - List arrayNumber; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_test.dart index 010b4b17a12..55b131a9e57 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/array_test.dart @@ -17,13 +17,10 @@ class ArrayTest { this.arrayArrayOfModel = const [], }); - List arrayOfString; - List> arrayArrayOfInteger; - List> arrayArrayOfModel; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/capitalization.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/capitalization.dart index c9175d38a09..afab73b9769 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/capitalization.dart @@ -20,19 +20,14 @@ class Capitalization { this.ATT_NAME, }); - String smallCamel; - String capitalCamel; - String smallSnake; - String capitalSnake; - String sCAETHFlowPoints; /// Name of the pet diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat.dart index cfd41551181..a5f1e7737d4 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat.dart @@ -17,13 +17,10 @@ class Cat { this.declawed, }); - String className; - String color; - bool declawed; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat_all_of.dart index ac8cb2ee19f..307e777da3d 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat_all_of.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/cat_all_of.dart @@ -15,7 +15,6 @@ class CatAllOf { this.declawed, }); - bool declawed; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/category.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/category.dart index 8d5b093534b..cf91101f6ab 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/category.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/category.dart @@ -16,10 +16,8 @@ class Category { this.name = 'default-name', }); - int id; - String name; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/class_model.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/class_model.dart index 83561274b6a..9192701eafd 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/class_model.dart @@ -15,7 +15,6 @@ class ClassModel { this.class_, }); - String class_; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/client.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/client.dart index 778d0a9f032..921dd1e66b9 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/client.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/client.dart @@ -15,7 +15,6 @@ class Client { this.client, }); - String client; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog.dart index 91e07b90aa2..dc8dec91942 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog.dart @@ -17,13 +17,10 @@ class Dog { this.breed, }); - String className; - String color; - String breed; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog_all_of.dart index c4fca6cd10a..0199b8707d1 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog_all_of.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/dog_all_of.dart @@ -15,7 +15,6 @@ class DogAllOf { this.breed, }); - String breed; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart index 7947beb8d32..b79f23df362 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart @@ -16,10 +16,8 @@ class EnumArrays { this.arrayEnum = const [], }); - EnumArraysJustSymbolEnum justSymbol; - List arrayEnum; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart index b2ef76116cc..371858d9ea6 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart @@ -22,28 +22,20 @@ class EnumTest { this.outerEnumIntegerDefaultValue, }); - EnumTestEnumStringEnum enumString; - EnumTestEnumStringRequiredEnum enumStringRequired; - EnumTestEnumIntegerEnum enumInteger; - EnumTestEnumNumberEnum enumNumber; - OuterEnum outerEnum; - OuterEnumInteger outerEnumInteger; - OuterEnumDefaultValue outerEnumDefaultValue; - OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/file_schema_test_class.dart index 5ff9c52e224..a6498793ded 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/file_schema_test_class.dart @@ -16,10 +16,8 @@ class FileSchemaTestClass { this.files = const [], }); - MultipartFile file; - List files; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo.dart index 95b17fe558a..19994af4cfe 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/foo.dart @@ -15,7 +15,6 @@ class Foo { this.bar = 'bar', }); - String bar; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/format_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/format_test.dart index 3d8a868b041..be03d7e024b 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/format_test.dart @@ -30,56 +30,42 @@ class FormatTest { this.patternWithDigitsAndDelimiter, }); - // minimum: 10 // maximum: 100 int integer; - // minimum: 20 // maximum: 200 int int32; - int int64; - // minimum: 32.1 // maximum: 543.2 num number; - // minimum: 54.3 // maximum: 987.6 double float; - // minimum: 67.8 // maximum: 123.4 double double_; - double decimal; - String string; - String byte; - MultipartFile binary; - DateTime date; - DateTime dateTime; - String uuid; - String password; /// A string that is a 10 digit number. Can have leading zeros. diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/has_only_read_only.dart index fd306184d05..2054a4594f3 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/has_only_read_only.dart @@ -16,10 +16,8 @@ class HasOnlyReadOnly { this.foo, }); - String bar; - String foo; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/health_check_result.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/health_check_result.dart index 495d4fea911..1ea8db9305c 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/health_check_result.dart @@ -15,7 +15,6 @@ class HealthCheckResult { this.nullableMessage, }); - String nullableMessage; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/inline_response_default.dart index 4498a5113b6..c48b5c28e70 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/inline_response_default.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/inline_response_default.dart @@ -15,7 +15,6 @@ class InlineResponseDefault { this.string, }); - Foo string; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart index 4cfa24dae95..2834ab2acf4 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart @@ -18,16 +18,12 @@ class MapTest { this.indirectMap = const {}, }); - Map> mapMapOfString; - Map mapOfEnumString; - Map directMap; - Map indirectMap; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart index d6f805fd61d..b9a202de856 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/mixed_properties_and_additional_properties_class.dart @@ -17,13 +17,10 @@ class MixedPropertiesAndAdditionalPropertiesClass { this.map = const {}, }); - String uuid; - DateTime dateTime; - Map map; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model200_response.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model200_response.dart index 7a929d6bc2e..15ecf90f50a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model200_response.dart @@ -16,10 +16,8 @@ class Model200Response { this.class_, }); - int name; - String class_; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_return.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_return.dart index 87ccbf3a97e..50c58ca70f1 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/model_return.dart @@ -15,7 +15,6 @@ class ModelReturn { this.return_, }); - int return_; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/name.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/name.dart index 9a12b6f271d..fd1592c969c 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/name.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/name.dart @@ -18,16 +18,12 @@ class Name { this.n123number, }); - int name; - int snakeCase; - String property; - int n123number; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/nullable_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/nullable_class.dart index 889764086fd..0295e97b0d2 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/nullable_class.dart @@ -26,40 +26,28 @@ class NullableClass { this.objectItemsNullable = const {}, }); - int integerProp; - num numberProp; - bool booleanProp; - String stringProp; - DateTime dateProp; - DateTime datetimeProp; - List arrayNullableProp; - List arrayAndItemsNullableProp; - List arrayItemsNullable; - Map objectNullableProp; - Map objectAndItemsNullableProp; - Map objectItemsNullable; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/number_only.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/number_only.dart index fc0bd0066d1..d710d3b50b2 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/number_only.dart @@ -15,7 +15,6 @@ class NumberOnly { this.justNumber, }); - num justNumber; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart index 268f751c0d5..30d60e0120a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart @@ -20,22 +20,17 @@ class Order { this.complete = false, }); - int id; - int petId; - int quantity; - DateTime shipDate; /// Order Status OrderStatusEnum status; - bool complete; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_composite.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_composite.dart index d2eb41223eb..d2942660d23 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_composite.dart @@ -17,13 +17,10 @@ class OuterComposite { this.myBoolean, }); - num myNumber; - String myString; - bool myBoolean; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart index a30551385c1..daa1c561e47 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart @@ -20,19 +20,14 @@ class Pet { this.status, }); - int id; - Category category; - String name; - List photoUrls; - List tags; /// pet status in the store diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/read_only_first.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/read_only_first.dart index d18d50a7a54..3d8382c019e 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/read_only_first.dart @@ -16,10 +16,8 @@ class ReadOnlyFirst { this.baz, }); - String bar; - String baz; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_model_name.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_model_name.dart index 8b29142ada8..846ca82a7db 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_model_name.dart @@ -15,7 +15,6 @@ class SpecialModelName { this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, }); - int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/tag.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/tag.dart index 482c5d6d14b..63132f08a3a 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/tag.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/tag.dart @@ -16,10 +16,8 @@ class Tag { this.name, }); - int id; - String name; @override diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/user.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/user.dart index f1f56e3d720..bb512af491f 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/user.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/user.dart @@ -22,25 +22,18 @@ class User { this.userStatus, }); - int id; - String username; - String firstName; - String lastName; - String email; - String password; - String phone; /// User Status